Fix Bug 57826

This commit is contained in:
Julia Radzhabova 2022-08-29 15:04:43 +03:00
parent b797fe25a3
commit 0d9b07a6e4

View file

@ -997,23 +997,27 @@ jQuery.fn.extend({
var _el = document.getElementById(id.substring(1)); var _el = document.getElementById(id.substring(1));
if ( !_el ) { if ( !_el ) {
parent = parent || this; parent = parent || this;
if ( parent instanceof jQuery ) { if ( parent && parent.length > 0 ) {
parent.each(function (i, node) { parent.each(function (i, node) {
_el = node.querySelectorAll(id); if (node.querySelectorAll) {
if ( _el.length == 0 ) { _el = node.querySelectorAll(id);
if ( ('#' + node.id) == id ) { if ( _el.length == 0 ) {
_el = node; if ( ('#' + node.id) == id ) {
_el = node;
return false;
}
} else
if ( _el.length ) {
_el = _el[0];
return false; return false;
} }
} else
if ( _el.length ) {
_el = _el[0];
return false;
} }
}) })
} else { } else {
_el = parent.querySelectorAll(id); if (parent && parent.querySelectorAll) {
if ( _el && _el.length ) return _el[0]; _el = parent.querySelectorAll(id);
if ( _el && _el.length ) return _el[0];
}
} }
} }