This commit is contained in:
@@ -107,6 +107,7 @@
|
||||
<script>
|
||||
/* xeslint-disable */
|
||||
import aboutInfo from "./api/aboutinfo";
|
||||
import gzmenu from "./api/gzmenu";
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
@@ -129,44 +130,46 @@ export default {
|
||||
//
|
||||
var that = this;
|
||||
this.$gzevent.$on("menu-change", function(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 = [];
|
||||
gzmenu.handleMenuChange(that, ctx);
|
||||
|
||||
//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 });
|
||||
}
|
||||
// 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 = [];
|
||||
|
||||
//GLOBAL BOTTOM PORTION
|
||||
// //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 sub-heading
|
||||
//Likely won't want this but here anyway to see
|
||||
//that.appBar.menuItems.push({ header: "GLOBAL" });
|
||||
// //GLOBAL BOTTOM PORTION
|
||||
|
||||
//global menu items
|
||||
// //Global sub-heading
|
||||
// //Likely won't want this but here anyway to see
|
||||
// //that.appBar.menuItems.push({ header: "GLOBAL" });
|
||||
|
||||
//Logout
|
||||
that.appBar.menuItems.push({
|
||||
title: this.$gzlocale.get("Logout"),
|
||||
icon: "sign-out-alt",
|
||||
color: "pink",
|
||||
key: "app:logout"
|
||||
});
|
||||
// //global menu items
|
||||
|
||||
//Insert help item
|
||||
that.appBar.menuItems.push({
|
||||
title: this.$gzlocale.get("MenuHelp"),
|
||||
icon: "question-circle",
|
||||
key: "app:help:" + that.appBar.helpUrl
|
||||
});
|
||||
// //Logout
|
||||
// that.appBar.menuItems.push({
|
||||
// title: this.$gzlocale.get("Logout"),
|
||||
// icon: "sign-out-alt",
|
||||
// color: "pink",
|
||||
// key: "app:logout"
|
||||
// });
|
||||
|
||||
// //Insert help item
|
||||
// that.appBar.menuItems.push({
|
||||
// title: this.$gzlocale.get("MenuHelp"),
|
||||
// icon: "question-circle",
|
||||
// key: "app:help:" + that.appBar.helpUrl
|
||||
// });
|
||||
}); //END OF EVENT
|
||||
|
||||
//////////////////////////////////
|
||||
|
||||
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