Update navigation when the url of the main column changes
This commit is contained in:
parent
ec9e9e8dfb
commit
ee63dfd310
|
@ -77,6 +77,12 @@
|
|||
$menu.data('icinga-url', menuDataUrl);
|
||||
};
|
||||
|
||||
Navigation.prototype.setActiveByUrl = function(url)
|
||||
{
|
||||
this.resetActive();
|
||||
this.setActive($('#menu [href="' + url + '"]'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the active menu element
|
||||
*
|
||||
|
|
|
@ -343,7 +343,9 @@
|
|||
var $matches = $.merge($('[href="' + url + '"]'), $forms);
|
||||
$matches.each(function (idx, el) {
|
||||
if ($(el).closest('#menu').length) {
|
||||
self.icinga.behaviors.navigation.resetActive();
|
||||
if (req.$target[0].id === 'col1') {
|
||||
self.icinga.behaviors.navigation.resetActive();
|
||||
}
|
||||
} else if ($(el).closest('table.action').length) {
|
||||
$(el).closest('table.action').find('.active').removeClass('active');
|
||||
}
|
||||
|
@ -355,7 +357,9 @@
|
|||
if ($el.is('form')) {
|
||||
$('input', $el).addClass('active');
|
||||
} else {
|
||||
self.icinga.behaviors.navigation.setActive($el);
|
||||
if (req.$target[0].id === 'col1') {
|
||||
self.icinga.behaviors.navigation.setActive($el);
|
||||
}
|
||||
}
|
||||
// Interrupt .each, only on menu item shall be active
|
||||
return false;
|
||||
|
|
|
@ -136,6 +136,7 @@
|
|||
var kill = this.cutContainer($('#col1'));
|
||||
this.pasteContainer($('#col1'), col2);
|
||||
this.fixControls();
|
||||
this.icinga.behaviors.navigation.setActiveByUrl($('#col1').data('icingaUrl'));
|
||||
},
|
||||
|
||||
cutContainer: function ($col) {
|
||||
|
|
Loading…
Reference in New Issue