This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
/* Xeslint-disable */
|
||||
import { processLogout } from "./authutil";
|
||||
|
||||
/////////////////////////////////
|
||||
// Menu utils and handlers (if necessary)
|
||||
// Menu utils and handlers
|
||||
//
|
||||
export default {
|
||||
///////////////////////////////
|
||||
@@ -46,7 +47,8 @@ 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
|
||||
});
|
||||
},
|
||||
///////////////////////////////
|
||||
@@ -75,19 +77,26 @@ export default {
|
||||
// Deal with a menu change request
|
||||
// called from App.vue
|
||||
handleClick(that, menuitem) {
|
||||
if (!menuitem.disabled && menuitem.key.startsWith("app:")) {
|
||||
if (menuitem.key.startsWith("app:help:")) {
|
||||
// "https://www.ayanova.com/AyaNova7webHelp/" +
|
||||
var helpurl =
|
||||
that.$store.state.helpUrl + menuitem.key.replace("app:help:", "");
|
||||
window.open(helpurl, "_blank");
|
||||
} else {
|
||||
alert("STUB gzmenu::handleClick - menu item clicked: " + menuitem.key);
|
||||
}
|
||||
//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" key of the menu item (e.g. the url in a app:help link)
|
||||
|
||||
//Logout
|
||||
// auth.logout();
|
||||
// this.$router.replace({ name: "login" });
|
||||
//Handle different items
|
||||
if (!menuitem.disabled && menuitem.key.startsWith("app:")) {
|
||||
switch (menuitem.key) {
|
||||
case "app:help":
|
||||
var helpurl = that.$store.state.helpUrl + menuitem.data;
|
||||
window.open(helpurl, "_blank");
|
||||
break;
|
||||
case "app:logout":
|
||||
processLogout();
|
||||
that.$router.replace({ name: "login" });
|
||||
break;
|
||||
default:
|
||||
alert(
|
||||
"gzmenu:handleClick - unrecognized command [" + menuitem.key + "]"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
//new functions above here
|
||||
|
||||
Reference in New Issue
Block a user