mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
js: Do not handle anchor jumps, the browser is able to do it by itself
refs #8615
This commit is contained in:
parent
8cf3b99335
commit
5ccd4a9ef8
@ -322,21 +322,6 @@
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle anchor, i.e. focus the element which is referenced by the anchor
|
|
||||||
*
|
|
||||||
* @param {string} query jQuery selector
|
|
||||||
*/
|
|
||||||
handleAnchor: function(query) {
|
|
||||||
var $element = $(query);
|
|
||||||
if ($element.length > 0) {
|
|
||||||
if (typeof $element.attr('tabindex') === 'undefined') {
|
|
||||||
$element.attr('tabindex', -1);
|
|
||||||
}
|
|
||||||
$element.focus();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Someone clicked a link or tr[href]
|
* Someone clicked a link or tr[href]
|
||||||
*/
|
*/
|
||||||
@ -397,17 +382,15 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is an anchor only
|
||||||
|
if (href.substr(0, 1) === '#' && href.length > 1 && href.substr(1, 1) !== '!') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Handle all other links as XHR requests
|
// Handle all other links as XHR requests
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
// This is an anchor only
|
|
||||||
if (href.substr(0, 1) === '#' && href.length > 1
|
|
||||||
&& href.substr(1, 1) !== '!') {
|
|
||||||
self.handleAnchor(href);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// activate spinner indicator
|
// activate spinner indicator
|
||||||
if ($a.hasClass('spinner')) {
|
if ($a.hasClass('spinner')) {
|
||||||
$a.addClass('active');
|
$a.addClass('active');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user