From 94a1955d867f36a40295440911687b39ef73a423 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 19 Apr 2019 17:34:51 +0000 Subject: [PATCH] --- ayanova/src/api/gzmenu.js | 25 +++++++++++---------- ayanova/src/views/About.vue | 5 +++-- ayanova/src/views/inventory-widget-edit.vue | 10 ++++----- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/ayanova/src/api/gzmenu.js b/ayanova/src/api/gzmenu.js index 6b63f7d5..295bdd0b 100644 --- a/ayanova/src/api/gzmenu.js +++ b/ayanova/src/api/gzmenu.js @@ -40,7 +40,7 @@ export default { title: that.$gzlocale.get("Logout"), icon: "sign-out-alt", color: "pink", - key: "app||logout" + key: "app:logout" }); //divider @@ -50,14 +50,16 @@ export default { that.appBar.menuItems.push({ title: that.$gzlocale.get("MenuHelp"), icon: "question-circle", - key: "app||help||" + that.appBar.helpUrl + key: "app:help", + data: that.appBar.helpUrl }); //ABOUT that.appBar.menuItems.push({ title: that.$gzlocale.get("HelpAboutAyaNova"), icon: "info-circle", - key: "app||nav||about" + key: "app:nav:abt", + data: "about" }); }, /////////////////////////////// @@ -86,20 +88,19 @@ export default { // Deal with a menu change request // called from App.vue handleClick(that, menuitem) { - //Key will start with the string "app||" if it's a global application command that should be handled here, + //Key will start with the string "app:" if it's a global application command that should be handled here, //otherwise it's a local command for a local form only - //If there is any extended information required for the command it will be in the key after the command portion of the menu item (e.g. the url in a app||help link) - //split a key into component parts, part one is the responsible party, part two is the command, part three to part * are all extra info - //each part is separated by a double pipe symbol || + //If there is any extended information required for the command it will be in the data property of the menu item + //split a key into component parts, part one is the responsible party, part two is the command, part three only exists to make it unique if necessary + //each part is separated by a colon //Handle different items - if (!menuitem.disabled && menuitem.key.startsWith("app||")) { - var keyparts = menuitem.key.split("||"); + if (!menuitem.disabled && menuitem.key.startsWith("app:")) { + var keyparts = menuitem.key.split(":"); var cmd = keyparts[1]; - var data = keyparts[2] ? keyparts[2] : null; switch (cmd) { case "help": - var helpurl = that.$store.state.helpUrl + data; + var helpurl = that.$store.state.helpUrl + menuitem.data; window.open(helpurl, "_blank"); break; case "logout": @@ -107,7 +108,7 @@ export default { that.$router.replace({ name: "login" }); break; case "nav": - that.$router.replace({ name: data }); + that.$router.replace({ name: menuitem.data }); break; default: alert( diff --git a/ayanova/src/views/About.vue b/ayanova/src/views/About.vue index b3ec2ba0..dcda82ea 100644 --- a/ayanova/src/views/About.vue +++ b/ayanova/src/views/About.vue @@ -108,7 +108,7 @@ import aboutInfo from "../api/aboutinfo"; function clickHandler(item) { - if (!item.disabled && !item.key.startsWith("app||")) { + if (!item.disabled && !item.key.startsWith("app:")) { alert("about.vue::context click: " + item.key); } } @@ -143,7 +143,8 @@ export default { title: this.$gzlocale.get("log"), icon: "glasses", surface: true, - key: "app||nav||log" + key: "app:nav:log", + data: "log" } ] }); diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index 4bbe3a2e..32a6e0ce 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -131,7 +131,7 @@