This commit is contained in:
@@ -56,12 +56,30 @@
|
||||
</v-list-tile>
|
||||
</template>
|
||||
</v-list>-->
|
||||
<v-list>
|
||||
<!-- MAIN MENU -->
|
||||
<v-list v-if="appBar.isMain">
|
||||
<v-list-tile
|
||||
v-for="item in appBar.mainMenuItems"
|
||||
:key="item.key"
|
||||
@click="$gzevent.$emit('main-menu-click',item.key)"
|
||||
>
|
||||
<v-divider v-if="item.divider" :key="index" :inset="item.inset"></v-divider>
|
||||
<v-list-tile-action>
|
||||
<v-icon v-if="item.icon">{{ "fa-" + item.icon }}</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>{{ item.title }}</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
<!-- CONTEXT MENU -->
|
||||
<v-list v-if="!appBar.isMain">
|
||||
<v-list-tile
|
||||
v-for="item in appBar.contextItems"
|
||||
:key="item.key"
|
||||
@click="$gzevent.$emit('context-click',item.key)"
|
||||
@click="$gzevent.$emit('context-menu-click',item.key)"
|
||||
>
|
||||
|
||||
<v-list-tile-action>
|
||||
<v-icon v-if="item.icon">{{ "fa-" + item.icon }}</v-icon>
|
||||
</v-list-tile-action>
|
||||
@@ -107,7 +125,11 @@ export default {
|
||||
icon: "",
|
||||
title: "",
|
||||
contextItems: [],
|
||||
mainMenuItems: []
|
||||
mainMenuItems: [
|
||||
{ title: "Log off", icon: "sign-out-alt", key: "app:logout" },
|
||||
{ title: "Help", key: "app:help" },
|
||||
{ divider: true }
|
||||
]
|
||||
},
|
||||
items: [
|
||||
{ header: "Today" },
|
||||
@@ -131,22 +153,21 @@ export default {
|
||||
subtitle:
|
||||
"<span class='text--primary'>Sandra Adams</span> — Do you have Paris recommendations? Have you ever been?"
|
||||
}
|
||||
],
|
||||
contextItems: []
|
||||
]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//subscribe to context menu changes
|
||||
var that = this;
|
||||
this.$gzevent.$on("context-menu-change", function(ctx) {
|
||||
this.$gzevent.$on("menu-change", function(ctx) {
|
||||
that.appBar.isMain = ctx.isMain;
|
||||
that.appBar.icon = ctx.icon;
|
||||
that.appBar.title = ctx.title;
|
||||
that.appBar.contextItems = ctx.contextItems ? ctx.contextItems : [];
|
||||
});
|
||||
|
||||
this.$gzevent.$on("context-click", function(key) {
|
||||
alert("App.vue::context click: " + key);
|
||||
this.$gzevent.$on("main-menu-click", function(key) {
|
||||
alert("App.vue::main-menu click: " + key);
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
@@ -127,7 +127,7 @@ export default {
|
||||
]);
|
||||
},
|
||||
created() {
|
||||
this.$gzevent.$emit("context-menu-change", {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-info-circle",
|
||||
title: this.$gzlocale.get("HelpAboutAyaNova")
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
HelloWorld
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$gzevent.$emit("context-menu-change", {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-home",
|
||||
title: this.$gzlocale.get("Home")
|
||||
|
||||
@@ -173,7 +173,7 @@ export default {
|
||||
});
|
||||
},
|
||||
created() {
|
||||
this.$gzevent.$emit("context-menu-change", {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
isMain: false,
|
||||
icon: "fa-splotch",
|
||||
title: this.$gzlocale.get("Widget"),
|
||||
@@ -184,11 +184,11 @@ export default {
|
||||
{ title: "Click Me 4", key: "4" }
|
||||
]
|
||||
});
|
||||
this.$gzevent.$on("context-click", clickHandler);
|
||||
this.$gzevent.$on("context-menu-click", clickHandler);
|
||||
this.getDataFromApi();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$gzevent.$off("context-click", clickHandler);
|
||||
this.$gzevent.$off("context-menu-click", clickHandler);
|
||||
},
|
||||
components: {},
|
||||
data() {
|
||||
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
});
|
||||
},
|
||||
created() {
|
||||
this.$gzevent.$emit("context-menu-change", {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-dolly",
|
||||
title: this.$gzlocale.get("Inventory")
|
||||
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$gzevent.$emit("context-menu-change", {
|
||||
this.$gzevent.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "",
|
||||
title: ""
|
||||
|
||||
Reference in New Issue
Block a user