mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
parent
de24f5f4b6
commit
5c80486b23
@ -325,11 +325,18 @@
|
|||||||
/**
|
/**
|
||||||
* Handle anchor, i.e. focus the element which is referenced by the anchor
|
* Handle anchor, i.e. focus the element which is referenced by the anchor
|
||||||
*
|
*
|
||||||
* @param {string} query jQuery selector
|
* @param {string} element The name or id of the element to focus
|
||||||
*/
|
*/
|
||||||
handleAnchor: function(query) {
|
handleAnchor: function(element) {
|
||||||
var $element = $(query);
|
var $element = $('#' + element);
|
||||||
if ($element.length > 0) {
|
if (! $element.length) {
|
||||||
|
// The name attribute is actually deprecated, on anchor tags,
|
||||||
|
// but we'll possibly handle links from another source
|
||||||
|
// (module etc) so that's used as a fallback
|
||||||
|
$element = $('[name="' + element + '"]');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($element.length) {
|
||||||
if (typeof $element.attr('tabindex') === 'undefined') {
|
if (typeof $element.attr('tabindex') === 'undefined') {
|
||||||
$element.attr('tabindex', -1);
|
$element.attr('tabindex', -1);
|
||||||
}
|
}
|
||||||
@ -404,7 +411,7 @@
|
|||||||
// This is an anchor only
|
// This is an anchor only
|
||||||
if (href.substr(0, 1) === '#' && href.length > 1
|
if (href.substr(0, 1) === '#' && href.length > 1
|
||||||
&& href.substr(1, 1) !== '!') {
|
&& href.substr(1, 1) !== '!') {
|
||||||
self.handleAnchor(href);
|
self.handleAnchor(href.substr(1));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user