This commit is contained in:
@@ -119,7 +119,7 @@ export default {
|
||||
});
|
||||
|
||||
this.$gzevent.$on("menu-click", function handleMenuClick(menuitem) {
|
||||
that.$gzmenu.handleClick(that, menuitem);
|
||||
that.$gzmenu.handleAppClick(that, menuitem);
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
@@ -83,11 +83,11 @@ export default {
|
||||
}
|
||||
},
|
||||
///////////////////////////////
|
||||
// CLICK HANDLER
|
||||
// APP (GLOBAL) CLICK HANDLER
|
||||
//
|
||||
// Deal with a menu change request
|
||||
// called from App.vue
|
||||
handleClick(that, menuitem) {
|
||||
handleAppClick(that, menuitem) {
|
||||
//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 data property of the menu item
|
||||
@@ -112,10 +112,24 @@ export default {
|
||||
break;
|
||||
default:
|
||||
alert(
|
||||
"gzmenu:handleClick - unrecognized command [" + menuitem.key + "]"
|
||||
"gzmenu:handleAppClick - unrecognized command [" +
|
||||
menuitem.key +
|
||||
"]"
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
///////////////////////////////
|
||||
// CONFIRM RELEVANT CLICK
|
||||
//
|
||||
// confirm the click is relevant
|
||||
// to a contextual caller
|
||||
// called by all forms except app.vue
|
||||
isRelevantClick(menuitem) {
|
||||
if (!menuitem.disabled && !menuitem.key.startsWith("app:")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//new functions above here
|
||||
};
|
||||
|
||||
@@ -107,11 +107,11 @@
|
||||
/* Xeslint-disable */
|
||||
import aboutInfo from "../api/aboutinfo";
|
||||
|
||||
function clickHandler(item) {
|
||||
if (!item.disabled && !item.key.startsWith("app:")) {
|
||||
alert("about.vue::context click: " + item.key);
|
||||
}
|
||||
}
|
||||
// function clickHandler(item) {
|
||||
// if (this.$gzmenu.isRelevantClick(item)) {
|
||||
// alert("about.vue::context click: " + item.key);
|
||||
// }
|
||||
// }
|
||||
|
||||
export default {
|
||||
beforeCreate() {
|
||||
@@ -148,7 +148,7 @@ export default {
|
||||
}
|
||||
]
|
||||
});
|
||||
this.$gzevent.$on("menu-click", clickHandler);
|
||||
// this.$gzevent.$on("menu-click", clickHandler);
|
||||
|
||||
this.clientInfo.version = aboutInfo.version;
|
||||
this.$gzapi
|
||||
@@ -161,7 +161,7 @@ export default {
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$gzevent.$off("menu-click", clickHandler);
|
||||
// this.$gzevent.$off("menu-click", clickHandler);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<script>
|
||||
/* xeslint-disable */
|
||||
function clickHandler(item) {
|
||||
if (!item.disabled && !item.key.startsWith("app:")) {
|
||||
if (this.$gzmenu.isRelevantClick(item)) {
|
||||
alert("inventory-widget-edit.vue::context click: " + item.key);
|
||||
}
|
||||
}
|
||||
@@ -201,6 +201,7 @@ export default {
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
this.$gzevent.$on("menu-click", clickHandler);
|
||||
this.getDataFromApi();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user