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.
This commit is contained in:
Johannes Meyer 2021-03-31 12:38:35 +02:00
parent e65ec1900a
commit a8be92c245
1 changed files with 3 additions and 15 deletions

View File

@ -1247,25 +1247,12 @@
}
}
});
if (discard) {
return;
}
// TODO: We do not want to wrap this twice...
var $content = $('<div>' + content + '</div>');
$('.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