This commit is contained in:
@@ -107,6 +107,7 @@
|
|||||||
<script>
|
<script>
|
||||||
/* xeslint-disable */
|
/* xeslint-disable */
|
||||||
import aboutInfo from "./api/aboutinfo";
|
import aboutInfo from "./api/aboutinfo";
|
||||||
|
import gzmenu from "./api/gzmenu";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
@@ -129,44 +130,46 @@ export default {
|
|||||||
//
|
//
|
||||||
var that = this;
|
var that = this;
|
||||||
this.$gzevent.$on("menu-change", function(ctx) {
|
this.$gzevent.$on("menu-change", function(ctx) {
|
||||||
that.appBar.isMain = ctx.isMain;
|
gzmenu.handleMenuChange(that, ctx);
|
||||||
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
|
// that.appBar.isMain = ctx.isMain;
|
||||||
//populate the context portion of the menu so handle accordingly
|
// that.appBar.icon = ctx.icon;
|
||||||
if (ctx.menuItems) {
|
// that.appBar.title = ctx.title;
|
||||||
that.appBar.menuItems = ctx.menuItems;
|
// //set the help url if presented or default to the top of the index
|
||||||
//DIVIDER
|
// that.appBar.helpUrl = ctx.helpUrl ? ctx.helpUrl : "index.html";
|
||||||
//Insert the devider between context and global items
|
// that.appBar.menuItems = [];
|
||||||
that.appBar.menuItems.push({ divider: true, inset: false });
|
|
||||||
}
|
|
||||||
|
|
||||||
//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
|
// //GLOBAL BOTTOM PORTION
|
||||||
//Likely won't want this but here anyway to see
|
|
||||||
//that.appBar.menuItems.push({ header: "GLOBAL" });
|
|
||||||
|
|
||||||
//global menu items
|
// //Global sub-heading
|
||||||
|
// //Likely won't want this but here anyway to see
|
||||||
|
// //that.appBar.menuItems.push({ header: "GLOBAL" });
|
||||||
|
|
||||||
//Logout
|
// //global menu items
|
||||||
that.appBar.menuItems.push({
|
|
||||||
title: this.$gzlocale.get("Logout"),
|
|
||||||
icon: "sign-out-alt",
|
|
||||||
color: "pink",
|
|
||||||
key: "app:logout"
|
|
||||||
});
|
|
||||||
|
|
||||||
//Insert help item
|
// //Logout
|
||||||
that.appBar.menuItems.push({
|
// that.appBar.menuItems.push({
|
||||||
title: this.$gzlocale.get("MenuHelp"),
|
// title: this.$gzlocale.get("Logout"),
|
||||||
icon: "question-circle",
|
// icon: "sign-out-alt",
|
||||||
key: "app:help:" + that.appBar.helpUrl
|
// 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
|
}); //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