From a8be92c2458202baf01930e7c3f71cb1389eaf72 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 31 Mar 2021 12:38:35 +0200 Subject: [PATCH] loader.js: Still apply some accessibility changes.. ..if a renderHook discards an autorefresh. There is unfortunately no way to distinguish between a renderHook that really discards changes or one that applies them on the DOM itself. If it's the first, this change *shouldn't* hurt. If it's the latter, users should benefit. --- public/js/icinga/loader.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index 3c9ce1dc2..30efe3ba0 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -1247,25 +1247,12 @@ } } }); - if (discard) { - return; - } - - // TODO: We do not want to wrap this twice... - var $content = $('
' + content + '
'); $('.container', $container).each(function() { _this.stopPendingRequestsFor($(this)); }); - if (false && - $('.dashboard', $content).length > 0 && - $('.dashboard', $container).length === 0 - ) { - // $('.dashboard', $content) - // $container.html(content); - - } else { + if (! discard) { if ($container.closest('.dashboard').length) { var title = $('h1', $container).first().detach(); $container.html(title).append(content); @@ -1275,9 +1262,10 @@ $container.append(content); } } + this.icinga.ui.assignUniqueContainerIds(); - if (navigationAnchor) { + if (! discard && navigationAnchor) { setTimeout(this.icinga.ui.focusElement.bind(this.icinga.ui), 0, navigationAnchor, $container); } else if (! activeElementPath) { // Active element was not in this container