This commit is contained in:
2019-04-17 22:13:38 +00:00
parent 33162d48dd
commit bc5f37ccf8

View File

@@ -32,38 +32,10 @@
<v-icon>fa-ellipsis-v</v-icon> <v-icon>fa-ellipsis-v</v-icon>
</v-btn> </v-btn>
</template> </template>
<!-- <v-list>
<v-list-tile v-for="(item, i) in items" :key="i">
<v-list-tile-title>{{ item.title }}</v-list-tile-title>
</v-list-tile>
</v-list>-->
<!-- <v-list two-line>
<template v-for="(item, index) in items">
<v-subheader v-if="item.header" :key="item.header">{{ item.header }}</v-subheader>
<v-divider v-else-if="item.divider" :key="index" :inset="item.inset"></v-divider>
<v-list-tile v-else :key="item.title" avatar @click="stubClick">
<v-list-tile-avatar>
<img :src="item.avatar">
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title v-html="item.title"></v-list-tile-title>
<v-list-tile-sub-title v-html="item.subtitle"></v-list-tile-sub-title>
</v-list-tile-content>
</v-list-tile>
</template>
</v-list>-->
<!-- MENU -->
<v-list> <v-list>
<template v-for="(item,index) in appBar.menuItems"> <template v-for="(item,index) in appBar.menuItems">
<v-subheader v-if="item.header" :key="index">{{ item.header }}</v-subheader> <v-subheader v-if="item.header" :key="index">{{ item.header }}</v-subheader>
<v-divider v-else-if="item.divider" :key="index" :inset="item.inset"></v-divider> <v-divider v-else-if="item.divider" :key="index" :inset="item.inset"></v-divider>
<v-list-tile <v-list-tile
v-else v-else
:key="item.key" :key="item.key"
@@ -125,51 +97,20 @@ export default {
}, },
created() { created() {
////////////////////////////////// //////////////////////////////////
// MENU DISPLAY EVENT HANDLER // MENU EVENT HANDLERS
//subscribe to menu changes //
// //
var that = this; var that = this;
this.$gzevent.$on("menu-change", function(ctx) { this.$gzevent.$on("menu-change", function(ctx) {
gzmenu.handleMenuChange(that, ctx); gzmenu.handleMenuChange(that, ctx);
}); //END OF EVENT });
//////////////////////////////////
// REPLACE KEY EVENT HANDLER
//
// (used to update a key in place more efficiently)
//
this.$gzevent.$on("menu-replace-item", function(newItem) { this.$gzevent.$on("menu-replace-item", function(newItem) {
gzmenu.handleReplaceMenuItem(that, newItem); gzmenu.handleReplaceMenuItem(that, newItem);
// if (!that.appBar.menuItems || !newItem) { });
// return;
// }
// //Find the key that is in the collection and replace it
// for (var i = 0; i < that.appBar.menuItems.length; i++) {
// if (that.appBar.menuItems[i].key == newItem.key) {
// //NOTE: since we are adding a new object, it has no reactivity in it so we need to use the Vue.Set to set it which
// //automatically adds the setters and getters that trigger reactivity
// //If it was set directly on the array it wouldn't update the UI
// that.$set(that.appBar.menuItems, i, newItem);
// return;
// }
// }
}); //END OF EVENT
//////////////////////////////////
//CLICK EVENT HANDLER
//
this.$gzevent.$on("menu-click", function(menuitem) { this.$gzevent.$on("menu-click", function(menuitem) {
gzmenu.handleClick(that, menuitem); gzmenu.handleClick(that, menuitem);
// if (!item.disabled && item.key.startsWith("app:")) {
// if (item.key.startsWith("app:help:")) {
// // "https://www.ayanova.com/AyaNova7webHelp/" +
// var helpurl =
// that.$store.state.helpUrl + item.key.replace("app:help:", "");
// window.open(helpurl, "_blank");
// } else {
// alert("STUB: App.vue::menu click: " + item.key);
// }
// }
}); });
}, },
beforeDestroy() { beforeDestroy() {