From 0a835c2d0b8feea109f7324946577b153fe3ad1d Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 16 Apr 2019 23:29:17 +0000 Subject: [PATCH] --- ayanova/src/App.vue | 45 +++++++++++++-------- ayanova/src/views/inventory-widget-edit.vue | 18 +++++---- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index c1cf703e..447d2d99 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -57,13 +57,12 @@ --> - + - {{ "fa-" + item.icon }} @@ -75,11 +74,10 @@ - {{ "fa-" + item.icon }} @@ -124,12 +122,8 @@ export default { isMain: true, icon: "", title: "", - contextItems: [], - mainMenuItems: [ - { title: "Log off", icon: "sign-out-alt", key: "app:logout" }, - { title: "Help", key: "app:help" }, - { divider: true } - ] + contextMenuItems: [], + mainMenuItems: [] }, items: [ { header: "Today" }, @@ -157,17 +151,36 @@ export default { }; }, created() { - //subscribe to context menu changes + //subscribe to menu changes var that = this; this.$gzevent.$on("menu-change", function(ctx) { that.appBar.isMain = ctx.isMain; that.appBar.icon = ctx.icon; that.appBar.title = ctx.title; - that.appBar.contextItems = ctx.contextItems ? ctx.contextItems : []; + if (!ctx.isMain) { + //context menu so handle accordingly + that.appBar.contextMenuItems = ctx.contextMenuItems + ? ctx.contextMenuItems + : []; + } else { + //main menu, put in the standard items that always show + that.appBar.mainMenuItems = [ + { title: "Log off", icon: "sign-out-alt", key: "app:logout" }, + { title: "Help", key: "app:help" } + ]; + //If other items specified add them above the standard ones + if (ctx.mainMenuItems) { + that.appBar.mainMenuItems = ctx.mainMenuItems.concat( + that.appBar.mainMenuItems + ); + } + } }); - this.$gzevent.$on("main-menu-click", function(key) { - alert("App.vue::main-menu click: " + key); + this.$gzevent.$on("menu-click", function(key) { + if (key.startsWith("app:")) { + alert("App.vue::menu click: " + key); + } }); }, beforeDestroy() { diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index 53df55de..969b33f4 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -131,7 +131,9 @@