This commit is contained in:
57
ayanova/src/api/gzdialog.js
Normal file
57
ayanova/src/api/gzdialog.js
Normal file
@@ -0,0 +1,57 @@
|
||||
/* Xeslint-disable */
|
||||
|
||||
/////////////////////////////////
|
||||
// Dialog, toast, notification
|
||||
// utils and handlers
|
||||
//
|
||||
export default {
|
||||
///////////////////////////////////
|
||||
// WIRE UP DIALOG EVENTS
|
||||
//
|
||||
// called once from app.vue only
|
||||
//
|
||||
wireUpEventHandlers(vm) {
|
||||
//Notifications: pops up and slowly disappears
|
||||
|
||||
///////////
|
||||
//ERROR
|
||||
vm.$gzevent.$on("notify-error", function handleNotifyWarn(msg) {
|
||||
vm.$dialog.notify.info(msg, {
|
||||
position: "top-right",
|
||||
icon: "fa-exclamation-triangle",
|
||||
timeout: 8000
|
||||
});
|
||||
});
|
||||
|
||||
///////////
|
||||
//WARNING
|
||||
vm.$gzevent.$on("notify-warning", function handleNotifyWarn(msg) {
|
||||
vm.$dialog.notify.warning(msg, {
|
||||
position: "top-right",
|
||||
icon: "fa-exclamation",
|
||||
timeout: 7000
|
||||
});
|
||||
});
|
||||
|
||||
///////////
|
||||
//INFO
|
||||
vm.$gzevent.$on("notify-info", function handleNotifyWarn(msg) {
|
||||
vm.$dialog.notify.info(msg, {
|
||||
position: "top-right",
|
||||
icon: "fa-info-circle",
|
||||
timeout: 6000
|
||||
});
|
||||
});
|
||||
|
||||
///////////
|
||||
//SUCCESS
|
||||
vm.$gzevent.$on("notify-success", function handleNotifyWarn(msg) {
|
||||
vm.$dialog.notify.success(msg, {
|
||||
position: "top-right",
|
||||
icon: "fa-check-circle ",
|
||||
timeout: 5000
|
||||
});
|
||||
});
|
||||
}
|
||||
//new functions above here
|
||||
};
|
||||
@@ -157,12 +157,12 @@ export default {
|
||||
vm: menuItem.vm ? menuItem.vm : null
|
||||
};
|
||||
},
|
||||
///////////////////////////////
|
||||
// WIRE UP MAIN APP EVENTS
|
||||
///////////////////////////////////
|
||||
// WIRE UP MENU EVENTS
|
||||
//
|
||||
// called only by app.vue
|
||||
// called once from app.vue only
|
||||
//
|
||||
wireUpAppEventHandlers(vm) {
|
||||
wireUpEventHandlers(vm) {
|
||||
var self = this;
|
||||
vm.$gzevent.$on("menu-change", function handleMenuChange(ctx) {
|
||||
self.handleMenuChange(vm, ctx);
|
||||
|
||||
Reference in New Issue
Block a user