Check unsaved changes before onRequestClose event
This commit is contained in:
parent
96633060b2
commit
0e52ef704b
|
@ -709,8 +709,29 @@ define([
|
|||
goBack: function(current) {
|
||||
if ( !Common.Controllers.Desktop.process('goback') ) {
|
||||
if (this.appOptions.customization.goback.requestClose && this.appOptions.canRequestClose) {
|
||||
Common.Gateway.requestClose();
|
||||
// Common.Controllers.Desktop.requestClose();
|
||||
if (this.api.isDocumentModified()) {
|
||||
var me = this;
|
||||
this.api.asc_stopSaving();
|
||||
Common.UI.warning({
|
||||
closable: false,
|
||||
width: 500,
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: this.leavePageTextOnClose,
|
||||
buttons: ['ok', 'cancel'],
|
||||
primary: 'ok',
|
||||
callback: function(btn) {
|
||||
if (btn == 'ok') {
|
||||
me.api.asc_undoAllChanges();
|
||||
Common.Gateway.requestClose();
|
||||
// Common.Controllers.Desktop.requestClose();
|
||||
} else
|
||||
me.api.asc_continueSaving();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Common.Gateway.requestClose();
|
||||
// Common.Controllers.Desktop.requestClose();
|
||||
}
|
||||
} else {
|
||||
var href = this.appOptions.customization.goback.url;
|
||||
if (!current && this.appOptions.customization.goback.blank!==false) {
|
||||
|
@ -2847,7 +2868,8 @@ define([
|
|||
textLongName: 'Enter a name that is less than 128 characters.',
|
||||
textGuest: 'Guest',
|
||||
errorSubmit: 'Submit failed.',
|
||||
txtClickToLoad: 'Click to load image'
|
||||
txtClickToLoad: 'Click to load image',
|
||||
leavePageTextOnClose: 'All unsaved changes in this document will be lost.<br> Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.'
|
||||
}
|
||||
})(), DE.Controllers.Main || {}))
|
||||
});
|
|
@ -842,6 +842,7 @@
|
|||
"DE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
|
||||
"DE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
|
||||
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
|
||||
"DE.Controllers.Main.leavePageTextOnClose": "All unsaved changes in this document will be lost.<br> Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.",
|
||||
"DE.Controllers.Navigation.txtBeginning": "Beginning of document",
|
||||
"DE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document",
|
||||
"DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked",
|
||||
|
|
|
@ -489,8 +489,28 @@ define([
|
|||
var me = this;
|
||||
if ( !Common.Controllers.Desktop.process('goback') ) {
|
||||
if (me.appOptions.customization.goback.requestClose && me.appOptions.canRequestClose) {
|
||||
Common.Gateway.requestClose();
|
||||
// Common.Controllers.Desktop.requestClose();
|
||||
if (this.api.isDocumentModified()) {
|
||||
this.api.asc_stopSaving();
|
||||
Common.UI.warning({
|
||||
closable: false,
|
||||
width: 500,
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: this.leavePageTextOnClose,
|
||||
buttons: ['ok', 'cancel'],
|
||||
primary: 'ok',
|
||||
callback: function(btn) {
|
||||
if (btn == 'ok') {
|
||||
me.api.asc_undoAllChanges();
|
||||
Common.Gateway.requestClose();
|
||||
// Common.Controllers.Desktop.requestClose();
|
||||
} else
|
||||
me.api.asc_continueSaving();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Common.Gateway.requestClose();
|
||||
// Common.Controllers.Desktop.requestClose();
|
||||
}
|
||||
} else {
|
||||
var href = me.appOptions.customization.goback.url;
|
||||
if (!current && me.appOptions.customization.goback.blank!==false) {
|
||||
|
@ -2480,7 +2500,8 @@ define([
|
|||
textRenameLabel: 'Enter a name to be used for collaboration',
|
||||
textRenameError: 'User name must not be empty.',
|
||||
textLongName: 'Enter a name that is less than 128 characters.',
|
||||
textGuest: 'Guest'
|
||||
textGuest: 'Guest',
|
||||
leavePageTextOnClose: 'All unsaved changes in this document will be lost.<br> Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.'
|
||||
}
|
||||
})(), PE.Controllers.Main || {}))
|
||||
});
|
||||
|
|
|
@ -709,6 +709,7 @@
|
|||
"PE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
|
||||
"PE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
|
||||
"PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
|
||||
"PE.Controllers.Main.leavePageTextOnClose": "All unsaved changes in this presentation will be lost.<br> Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.",
|
||||
"PE.Controllers.Statusbar.zoomText": "Zoom {0}%",
|
||||
"PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the system fonts, the saved font will be used when it is available.<br>Do you want to continue?",
|
||||
"PE.Controllers.Toolbar.textAccent": "Accents",
|
||||
|
|
|
@ -552,8 +552,28 @@ define([
|
|||
var me = this;
|
||||
if ( !Common.Controllers.Desktop.process('goback') ) {
|
||||
if (me.appOptions.customization.goback.requestClose && me.appOptions.canRequestClose) {
|
||||
Common.Gateway.requestClose();
|
||||
// Common.Controllers.Desktop.requestClose();
|
||||
if (this.api.asc_isDocumentModified()) {
|
||||
this.api.asc_stopSaving();
|
||||
Common.UI.warning({
|
||||
closable: false,
|
||||
width: 500,
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: this.leavePageTextOnClose,
|
||||
buttons: ['ok', 'cancel'],
|
||||
primary: 'ok',
|
||||
callback: function(btn) {
|
||||
if (btn == 'ok') {
|
||||
me.api.asc_undoAllChanges();
|
||||
Common.Gateway.requestClose();
|
||||
// Common.Controllers.Desktop.requestClose();
|
||||
} else
|
||||
me.api.asc_continueSaving();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Common.Gateway.requestClose();
|
||||
// Common.Controllers.Desktop.requestClose();
|
||||
}
|
||||
} else {
|
||||
var href = me.appOptions.customization.goback.url;
|
||||
if (!current && me.appOptions.customization.goback.blank!==false) {
|
||||
|
@ -2837,7 +2857,8 @@ define([
|
|||
txtMonths: 'Months',
|
||||
txtQuarters: 'Quarters',
|
||||
txtYears: 'Years',
|
||||
errorPivotGroup: 'Cannot group that selection.'
|
||||
errorPivotGroup: 'Cannot group that selection.',
|
||||
leavePageTextOnClose: 'All unsaved changes in this document will be lost.<br> Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.'
|
||||
}
|
||||
})(), SSE.Controllers.Main || {}))
|
||||
});
|
||||
|
|
|
@ -921,6 +921,7 @@
|
|||
"SSE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
|
||||
"SSE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
|
||||
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
|
||||
"SSE.Controllers.Main.leavePageTextOnClose": "All unsaved changes in this spreadsheet will be lost.<br> Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.",
|
||||
"SSE.Controllers.Print.strAllSheets": "All Sheets",
|
||||
"SSE.Controllers.Print.textFirstCol": "First column",
|
||||
"SSE.Controllers.Print.textFirstRow": "First row",
|
||||
|
|
Loading…
Reference in a new issue