mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-11-25 09:33:20 +01:00
open menu with name
This commit is contained in:
parent
264316ebea
commit
cdab348a87
@ -35,12 +35,18 @@ menu.element = {
|
||||
frame: null
|
||||
};
|
||||
|
||||
menu.open = () => {
|
||||
menu.open = (name) => {
|
||||
|
||||
menu.element.frame = new MenuFrame({
|
||||
navData: menu.navData
|
||||
});
|
||||
|
||||
if (name) {
|
||||
|
||||
menu.element.frame.menuNav.state.toggle(name);
|
||||
|
||||
};
|
||||
|
||||
menu.element.frame.open();
|
||||
|
||||
};
|
||||
|
@ -34,7 +34,7 @@ export const MenuNav = function({
|
||||
|
||||
item.active = false;
|
||||
|
||||
if (item.name === name) {
|
||||
if (item.name === name || item.name.toLowerCase() === name) {
|
||||
item.active = true;
|
||||
};
|
||||
|
||||
@ -67,11 +67,13 @@ export const MenuNav = function({
|
||||
};
|
||||
|
||||
this.update = () => {
|
||||
|
||||
navData.forEach((item, i) => {
|
||||
|
||||
if (this.state.current[this.makeId(item.name)]) {
|
||||
|
||||
this.element.item[i].menuNavItem.classList.add('active');
|
||||
|
||||
this.element.item[i].topLevel.classList.add('active');
|
||||
|
||||
if (item.sub) {
|
||||
@ -85,7 +87,9 @@ export const MenuNav = function({
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
this.element.item[i].menuNavItem.classList.remove('active');
|
||||
|
||||
this.element.item[i].topLevel.classList.remove('active');
|
||||
|
||||
if (item.sub) {
|
||||
@ -101,6 +105,7 @@ export const MenuNav = function({
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
this.nav = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user