Do not drop preselection in the navigation on reload

This commit is contained in:
Matthias Jentsch 2014-09-09 15:32:07 +02:00
parent 157818c8e7
commit b7c207a9cb
2 changed files with 12 additions and 2 deletions

View File

@ -159,6 +159,12 @@
$selectedMenu = $outerMenu;
}
$selectedMenu.addClass('active');
} else {
// store menu state
var $menus = $('[role="navigation"] li.active', el);
if ($menus.size()) {
activeMenuId = $menus[0].id;
}
}
},

View File

@ -673,8 +673,12 @@
}
var origFocus = document.activeElement;
if (typeof containerId !== 'undefined' && autorefresh && origFocus && $(origFocus).closest('form').length && $container.has($(origFocus)) && $(origFocus).closest('#' + containerId).length && ! $(origFocus).hasClass('autosubmit')) {
this.icinga.logger.debug('Not changing content, form has focus');
if (
// Do not reload menu when search field has content
(containerId === 'menu' && $(origFocus).length && $(origFocus).val().length)
// TODO: remove once #7146 is solved
|| (containerId !== 'menu' && typeof containerId !== 'undefined' && autorefresh && origFocus && $(origFocus).closest('form').length && $container.has($(origFocus)) && $(origFocus).closest('#' + containerId).length && ! $(origFocus).hasClass('autosubmit'))) {
this.icinga.logger.debug('Not changing content for ', containerId, ' form has focus');
return;
}