JS: Respect container in Icinga.Ui.focusElement()
Though IDs should be unique across the whole page, focusElement() must not fail if there is the same anchor in the left and right column. focusElement() now also respects the container when searching the element to focus by ID.
This commit is contained in:
parent
05135e716e
commit
0355b20da0
|
@ -153,7 +153,11 @@
|
|||
var $element = element;
|
||||
|
||||
if (typeof element === 'string') {
|
||||
$element = $('#' + element);
|
||||
if ($container && $container.length) {
|
||||
$element = $container.find('#' + element);
|
||||
} else {
|
||||
$element = $('#' + element);
|
||||
}
|
||||
|
||||
if (! $element.length) {
|
||||
// The name attribute is actually deprecated, on anchor tags,
|
||||
|
|
Loading…
Reference in New Issue