This commit is contained in:
@@ -119,7 +119,7 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.$gzevent.$on("menu-click", function handleMenuClick(menuitem) {
|
this.$gzevent.$on("menu-click", function handleMenuClick(menuitem) {
|
||||||
that.$gzmenu.handleClick(that, menuitem);
|
that.$gzmenu.handleAppClick(that, menuitem);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
|||||||
@@ -83,11 +83,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
// CLICK HANDLER
|
// APP (GLOBAL) CLICK HANDLER
|
||||||
//
|
//
|
||||||
// Deal with a menu change request
|
// Deal with a menu change request
|
||||||
// called from App.vue
|
// called from App.vue
|
||||||
handleClick(that, menuitem) {
|
handleAppClick(that, menuitem) {
|
||||||
//Key will start with the string "app:" if it's a global application command that should be handled here,
|
//Key will start with the string "app:" if it's a global application command that should be handled here,
|
||||||
//otherwise it's a local command for a local form only
|
//otherwise it's a local command for a local form only
|
||||||
//If there is any extended information required for the command it will be in the data property of the menu item
|
//If there is any extended information required for the command it will be in the data property of the menu item
|
||||||
@@ -112,10 +112,24 @@ export default {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
alert(
|
alert(
|
||||||
"gzmenu:handleClick - unrecognized command [" + menuitem.key + "]"
|
"gzmenu:handleAppClick - unrecognized command [" +
|
||||||
|
menuitem.key +
|
||||||
|
"]"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
///////////////////////////////
|
||||||
|
// CONFIRM RELEVANT CLICK
|
||||||
|
//
|
||||||
|
// confirm the click is relevant
|
||||||
|
// to a contextual caller
|
||||||
|
// called by all forms except app.vue
|
||||||
|
isRelevantClick(menuitem) {
|
||||||
|
if (!menuitem.disabled && !menuitem.key.startsWith("app:")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
//new functions above here
|
//new functions above here
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -107,11 +107,11 @@
|
|||||||
/* Xeslint-disable */
|
/* Xeslint-disable */
|
||||||
import aboutInfo from "../api/aboutinfo";
|
import aboutInfo from "../api/aboutinfo";
|
||||||
|
|
||||||
function clickHandler(item) {
|
// function clickHandler(item) {
|
||||||
if (!item.disabled && !item.key.startsWith("app:")) {
|
// if (this.$gzmenu.isRelevantClick(item)) {
|
||||||
alert("about.vue::context click: " + item.key);
|
// alert("about.vue::context click: " + item.key);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
@@ -148,7 +148,7 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
this.$gzevent.$on("menu-click", clickHandler);
|
// this.$gzevent.$on("menu-click", clickHandler);
|
||||||
|
|
||||||
this.clientInfo.version = aboutInfo.version;
|
this.clientInfo.version = aboutInfo.version;
|
||||||
this.$gzapi
|
this.$gzapi
|
||||||
@@ -161,7 +161,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.$gzevent.$off("menu-click", clickHandler);
|
// this.$gzevent.$off("menu-click", clickHandler);
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -131,7 +131,7 @@
|
|||||||
<script>
|
<script>
|
||||||
/* xeslint-disable */
|
/* xeslint-disable */
|
||||||
function clickHandler(item) {
|
function clickHandler(item) {
|
||||||
if (!item.disabled && !item.key.startsWith("app:")) {
|
if (this.$gzmenu.isRelevantClick(item)) {
|
||||||
alert("inventory-widget-edit.vue::context click: " + item.key);
|
alert("inventory-widget-edit.vue::context click: " + item.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,6 +201,7 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$gzevent.$on("menu-click", clickHandler);
|
this.$gzevent.$on("menu-click", clickHandler);
|
||||||
this.getDataFromApi();
|
this.getDataFromApi();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user