Merge pull request #4823 from Icinga/fix/new-user-menu-forgets-active-states-4791
Fix that the new user menu forgets active states
This commit is contained in:
commit
01a348ff8e
|
@ -263,7 +263,7 @@ class ConfigMenu extends BaseHtmlElement
|
||||||
[
|
[
|
||||||
HtmlElement::create(
|
HtmlElement::create(
|
||||||
'a',
|
'a',
|
||||||
Attributes::create(['href' => $item['url']]),
|
Attributes::create(['href' => Url::fromPath($item['url'])]),
|
||||||
[
|
[
|
||||||
$item['label'],
|
$item['label'],
|
||||||
isset($healthBadge) ? $healthBadge : ''
|
isset($healthBadge) ? $healthBadge : ''
|
||||||
|
|
|
@ -221,8 +221,19 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Navigation.prototype.setActiveAndSelected = function ($el) {
|
Navigation.prototype.setActiveAndSelected = function ($el) {
|
||||||
|
if ($el.length > 1) {
|
||||||
|
$el.each(el => {
|
||||||
|
if (! this.active) {
|
||||||
|
this.setActiveAndSelected($(el));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if ($el.length) {
|
||||||
|
if ($el[0].offsetWidth || $el[0].offsetHeight || $el.closest('.config-menu').length) {
|
||||||
|
// It's either a visible menu item or a config menu item
|
||||||
this.setActive($el);
|
this.setActive($el);
|
||||||
this.setSelected($el);
|
this.setSelected($el);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue