navigation.js: Only activate visible items or config menu items

This commit is contained in:
Johannes Meyer 2022-06-14 17:10:18 +02:00
parent db2c30d418
commit 1e143244e2
1 changed files with 13 additions and 2 deletions

View File

@ -221,8 +221,19 @@
};
Navigation.prototype.setActiveAndSelected = function ($el) {
this.setActive($el);
this.setSelected($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.setSelected($el);
}
}
};
/**