loader.js: Don't scroll to nav anchors that don't want this

This commit is contained in:
Johannes Meyer 2021-11-02 16:24:13 +01:00
parent f734d28060
commit 698ac5812f
1 changed files with 6 additions and 1 deletions

View File

@ -1298,7 +1298,12 @@
this.icinga.ui.assignUniqueContainerIds();
if (! discard && navigationAnchor) {
setTimeout(this.icinga.ui.focusElement.bind(this.icinga.ui), 0, navigationAnchor, $container);
var $element = $container.find('#' + navigationAnchor);
if ($element.length) {
// data-icinga-no-scroll-on-focus is NOT designed to avoid scrolling for non-XHR requests
setTimeout(this.icinga.ui.focusElement.bind(this.icinga.ui), 0,
$element, $container, ! $element.is('[data-icinga-no-scroll-on-focus]'));
}
} else if (! activeElementPath) {
// Active element was not in this container
if (! autorefresh && ! autoSubmit && ! scripted) {