This commit is contained in:
53
ayanova/src/api/gzmenu.js
Normal file
53
ayanova/src/api/gzmenu.js
Normal 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
|
||||
};
|
||||
Reference in New Issue
Block a user