This commit is contained in:
2019-04-17 22:02:48 +00:00
parent 6bbbc8956c
commit 132b0cd16d
2 changed files with 88 additions and 32 deletions

53
ayanova/src/api/gzmenu.js Normal file
View File

@@ -0,0 +1,53 @@
/* Xeslint-disable */
/////////////////////////////////
// Menu utils and handlers (if necessary)
//
export default {
///////////////////////////////
// CHANGE HANDLER
//
// Deal with a menu change request
// called from App.vue
handleMenuChange(that, ctx) {
that.appBar.isMain = ctx.isMain;
that.appBar.icon = ctx.icon;
that.appBar.title = ctx.title;
//set the help url if presented or default to the top of the index
that.appBar.helpUrl = ctx.helpUrl ? ctx.helpUrl : "index.html";
that.appBar.menuItems = [];
//CONTEXT TOP PORTION
//populate the context portion of the menu so handle accordingly
if (ctx.menuItems) {
that.appBar.menuItems = ctx.menuItems;
//DIVIDER
//Insert the devider between context and global items
that.appBar.menuItems.push({ divider: true, inset: false });
}
//GLOBAL BOTTOM PORTION
//Global sub-heading
//Likely won't want this but here anyway to see
//that.appBar.menuItems.push({ header: "GLOBAL" });
//global menu items
//Logout
that.appBar.menuItems.push({
title: that.$gzlocale.get("Logout"),
icon: "sign-out-alt",
color: "pink",
key: "app:logout"
});
//Insert help item
that.appBar.menuItems.push({
title: that.$gzlocale.get("MenuHelp"),
icon: "question-circle",
key: "app:help:" + that.appBar.helpUrl
});
}
//new functions above here
};