From 5ccd4a9ef8084d6e47d0d99f587da78a9e8c5155 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 6 Aug 2015 10:24:56 +0200 Subject: [PATCH] js: Do not handle anchor jumps, the browser is able to do it by itself refs #8615 --- public/js/icinga/events.js | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index e29b7d0e7..368ef6931 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -322,21 +322,6 @@ 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] */ @@ -397,17 +382,15 @@ 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 event.stopPropagation(); 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 if ($a.hasClass('spinner')) { $a.addClass('active');