This commit is contained in:
2019-04-17 22:09:49 +00:00
parent 132b0cd16d
commit cbe2e252e2
2 changed files with 63 additions and 63 deletions

View File

@@ -48,6 +48,43 @@ export default {
icon: "question-circle",
key: "app:help:" + that.appBar.helpUrl
});
},
///////////////////////////////
// CHANGE HANDLER
//
// Deal with a menu item update request
// called from App.vue
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;
}
}
},
///////////////////////////////
// CLICK HANDLER
//
// Deal with a menu change request
// called from App.vue
handleClick(that, menuitem) {
if (!menuitem.disabled && menuitem.key.startsWith("app:")) {
if (menuitem.key.startsWith("app:help:")) {
// "https://www.ayanova.com/AyaNova7webHelp/" +
var helpurl =
that.$store.state.helpUrl + menuitem.key.replace("app:help:", "");
window.open(helpurl, "_blank");
} else {
alert("STUB gzmenu::handleClick - menu item clicked: " + menuitem.key);
}
}
}
//new functions above here
};