mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
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);
|
$menu.data('icinga-url', menuDataUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Navigation.prototype.setActiveByUrl = function(url)
|
||||||
|
{
|
||||||
|
this.resetActive();
|
||||||
|
this.setActive($('#menu [href="' + url + '"]'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the active menu element
|
* Change the active menu element
|
||||||
*
|
*
|
||||||
|
@ -343,7 +343,9 @@
|
|||||||
var $matches = $.merge($('[href="' + url + '"]'), $forms);
|
var $matches = $.merge($('[href="' + url + '"]'), $forms);
|
||||||
$matches.each(function (idx, el) {
|
$matches.each(function (idx, el) {
|
||||||
if ($(el).closest('#menu').length) {
|
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) {
|
} else if ($(el).closest('table.action').length) {
|
||||||
$(el).closest('table.action').find('.active').removeClass('active');
|
$(el).closest('table.action').find('.active').removeClass('active');
|
||||||
}
|
}
|
||||||
@ -355,7 +357,9 @@
|
|||||||
if ($el.is('form')) {
|
if ($el.is('form')) {
|
||||||
$('input', $el).addClass('active');
|
$('input', $el).addClass('active');
|
||||||
} else {
|
} 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
|
// Interrupt .each, only on menu item shall be active
|
||||||
return false;
|
return false;
|
||||||
|
@ -136,6 +136,7 @@
|
|||||||
var kill = this.cutContainer($('#col1'));
|
var kill = this.cutContainer($('#col1'));
|
||||||
this.pasteContainer($('#col1'), col2);
|
this.pasteContainer($('#col1'), col2);
|
||||||
this.fixControls();
|
this.fixControls();
|
||||||
|
this.icinga.behaviors.navigation.setActiveByUrl($('#col1').data('icingaUrl'));
|
||||||
},
|
},
|
||||||
|
|
||||||
cutContainer: function ($col) {
|
cutContainer: function ($col) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user