From d475b8aff99615e0cd81ceb56aeb0071dd186870 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 16 Apr 2019 22:12:44 +0000 Subject: [PATCH] --- ayanova/src/App.vue | 21 +++++++++++++++++---- ayanova/src/store.js | 12 +----------- ayanova/src/views/About.vue | 3 ++- ayanova/src/views/Home.vue | 2 +- ayanova/src/views/inventory-widget-edit.vue | 2 +- ayanova/src/views/inventory.vue | 2 +- ayanova/src/views/login.vue | 2 +- 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index d602ac95..8c3f686e 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -98,6 +98,13 @@ export default { data() { return { drawer: null, + appBar: { + isMain: true, + icon: "", + title: "", + contextMenuItems: [], + mainMenuItems: [] + }, items: [ { header: "Today" }, { @@ -131,8 +138,16 @@ export default { }, mounted() { //subscribe to context menu changes + var that = this; this.$gzevent.$on("context-menu-change", function(ctx) { - alert("CLICK " + ctx); + that.appBar.isMain = ctx.isMain; + that.appBar.icon = ctx.icon; + that.appBar.title = ctx.title; + that.appBar.contextMenuItems = ctx.contextMenuItems + ? ctx.contextMenuItems + : []; + + //alert("CLICK " + ctx); }); //redirect to login if not authenticated if (!this.$store.state.authenticated) { @@ -157,9 +172,7 @@ export default { navItems() { return this.$store.state.navItems; }, - appBar() { - return this.$store.state.appBar; - }, + copyright() { return aboutInfo.copyright; }, diff --git a/ayanova/src/store.js b/ayanova/src/store.js index 8481eb04..4505b86b 100644 --- a/ayanova/src/store.js +++ b/ayanova/src/store.js @@ -18,14 +18,7 @@ export default new Vuex.Store({ roles: 0, localeText: {}, navItems: [], - logArray: [], - appBar: { - isMain: true, - icon: "", - title: "", - contextMenuItems: [], - mainMenuItems: [] - } + logArray: [] }, mutations: { login(state, data) { @@ -65,9 +58,6 @@ export default new Vuex.Store({ state.logArray.length - MaxLogLength ); } - }, - setAppBar(state, data) { - state.appBar = data; } }, actions: {} diff --git a/ayanova/src/views/About.vue b/ayanova/src/views/About.vue index 19867683..e34b7737 100644 --- a/ayanova/src/views/About.vue +++ b/ayanova/src/views/About.vue @@ -127,11 +127,12 @@ export default { ]); }, created() { - this.$store.commit("setAppBar", { + this.$gzevent.$emit("context-menu-change", { isMain: true, icon: "fa-info-circle", title: this.$gzlocale.get("HelpAboutAyaNova") }); + this.clientInfo.version = aboutInfo.version; this.$gzapi .get("ServerInfo") diff --git a/ayanova/src/views/Home.vue b/ayanova/src/views/Home.vue index 76e7af74..f7dc1bd2 100644 --- a/ayanova/src/views/Home.vue +++ b/ayanova/src/views/Home.vue @@ -10,7 +10,7 @@ export default { HelloWorld }, beforeCreate() { - this.$store.commit("setAppBar", { + this.$gzevent.$emit("context-menu-change", { isMain: true, icon: "fa-home", title: this.$gzlocale.get("Home") diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index d0e77844..1fd37591 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -171,7 +171,7 @@ export default { }); }, created() { - this.$store.commit("setAppBar", { + this.$gzevent.$emit("context-menu-change", { isMain: false, icon: "fa-splotch", title: this.$gzlocale.get("Widget") diff --git a/ayanova/src/views/inventory.vue b/ayanova/src/views/inventory.vue index 0fb061be..d2df7a8d 100644 --- a/ayanova/src/views/inventory.vue +++ b/ayanova/src/views/inventory.vue @@ -48,7 +48,7 @@ export default { }); }, created() { - this.$store.commit("setAppBar", { + this.$gzevent.$emit("context-menu-change", { isMain: true, icon: "fa-dolly", title: this.$gzlocale.get("Inventory") diff --git a/ayanova/src/views/login.vue b/ayanova/src/views/login.vue index c9b6b513..c9aade75 100644 --- a/ayanova/src/views/login.vue +++ b/ayanova/src/views/login.vue @@ -65,7 +65,7 @@ export default { }; }, created() { - this.$store.commit("setAppBar", { + this.$gzevent.$emit("context-menu-change", { isMain: true, icon: "", title: ""