This commit is contained in:
2020-07-03 17:14:35 +00:00
parent a5689861dc
commit 0576414cd9
4 changed files with 48 additions and 12 deletions

View File

@@ -230,6 +230,25 @@ export default {
}
},
///////////////////////////////
// CHANGE ICON HANDLER
// Change icon dymanically
// (note, can pass null for new icon to clear it)
//
handleChangeMenuItemIcon(vm, key, newIcon) {
if (!vm.appBar.menuItems || !key) {
return;
}
//Find the menu item and change it's icon
for (let i = 0; i < vm.appBar.menuItems.length; i++) {
let menuItem = vm.appBar.menuItems[i];
if (menuItem.key == key) {
vm.$set(vm.appBar.menuItems[i], "icon", newIcon);
return;
}
}
},
///////////////////////////////
// APP (GLOBAL) CLICK HANDLER
//
// Deal with a menu change request
@@ -349,6 +368,13 @@ export default {
self.handleDisableMenuItem(vm, key, false);
});
window.$gz.eventBus.$on(
"menu-change-item-icon",
function handleChangeMenuItemIcon(key, newIcon) {
self.handleChangeMenuItemIcon(vm, key, newIcon);
}
);
window.$gz.eventBus.$on("menu-click", function handleMenuClick(menuitem) {
self.handleAppClick(vm, menuitem);
});

View File

@@ -734,9 +734,6 @@ function initNavPanel() {
);
window.$gz.store.commit("setHomePage", "/ay-evaluate");
}
// //*** LOGOUT - all users
// addNavItem("Logout", "fa-sign-out-alt", "/login", [], key++, "logout");
}
async function getUserOptions() {