This commit is contained in:
2019-11-08 21:44:54 +00:00
parent 67e025a32c
commit b5d2a72f65
2 changed files with 25 additions and 20 deletions

View File

@@ -92,7 +92,6 @@ TODO:
// }, // },
confirmDelete() { confirmDelete() {
return VM_LOCAL.$root.$gzconfirm({ return VM_LOCAL.$root.$gzconfirm({
title: window.$gz.locale.get("Delete"),
message: window.$gz.locale.get("DeletePrompt"), message: window.$gz.locale.get("DeletePrompt"),
yesButtonText: window.$gz.locale.get("Delete"), yesButtonText: window.$gz.locale.get("Delete"),
noButtonText: window.$gz.locale.get("Cancel") noButtonText: window.$gz.locale.get("Cancel")
@@ -101,23 +100,29 @@ TODO:
///////////////////////////////////// /////////////////////////////////////
// Are you sure you want to delete? // Are you sure you want to delete?
// //
confirmLeaveUnsaved(vm) { confirmLeaveUnsaved() {
return vm.$dialog.warning({ return VM_LOCAL.$root.$gzconfirm({
text: window.$gz.locale.get("AreYouSureUnsavedChanges"), message: window.$gz.locale.get("AreYouSureUnsavedChanges"),
title: window.$gz.locale.get("Leave"), yesButtonText: window.$gz.locale.get("Leave"),
icon: "fa-exclamation-triangle", noButtonText: window.$gz.locale.get("Cancel")
actions: [
{
text: window.$gz.locale.get("Cancel"),
key: false
},
{
text: window.$gz.locale.get("Leave"),
color: "red",
key: true
}
]
}); });
// return vm.$dialog.warning({
// text: window.$gz.locale.get("AreYouSureUnsavedChanges"),
// title: window.$gz.locale.get("Leave"),
// icon: "fa-exclamation-triangle",
// actions: [
// {
// text: window.$gz.locale.get("Cancel"),
// key: false
// },
// {
// text: window.$gz.locale.get("Leave"),
// color: "red",
// key: true
// }
// ]
// });
}, },
///////////////////////////////////// /////////////////////////////////////
// Display LT message with wait for ok // Display LT message with wait for ok

View File

@@ -293,9 +293,9 @@ export default {
// don't forget to call next() // don't forget to call next()
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
var vm = this; //var vm = this;
if (this.formState.dirty && !JUST_DELETED) { if (this.formState.dirty && !JUST_DELETED) {
window.$gz.dialog.confirmLeaveUnsaved(vm).then(dialogResult => { window.$gz.dialog.confirmLeaveUnsaved().then(dialogResult => {
if (dialogResult == true) { if (dialogResult == true) {
next(); next();
} else { } else {
@@ -497,7 +497,7 @@ export default {
}, },
remove() { remove() {
var vm = this; var vm = this;
window.$gz.dialog.confirmDelete(vm).then(dialogResult => { window.$gz.dialog.confirmDelete().then(dialogResult => {
if (dialogResult == true) { if (dialogResult == true) {
//do the delete //do the delete
vm.formState.loading = true; vm.formState.loading = true;