diff --git a/javascript/LeftAndMain.EditForm.js b/javascript/LeftAndMain.EditForm.js index fe0d4a5c..c4612dda 100644 --- a/javascript/LeftAndMain.EditForm.js +++ b/javascript/LeftAndMain.EditForm.js @@ -53,11 +53,11 @@ * Checks the jquery.changetracker plugin status for this form. * Usually bound to window.onbeforeunload. * - * @param {boolean} doConfirm + * @param {boolean} isUnloadEvent * @return Either a string with a confirmation message, or the result of a confirm() dialog, - * based on the doConfirm parameter. + * based on the isUnloadEvent parameter. */ - _checkChangeTracker: function(doConfirm) { + _checkChangeTracker: function(isUnloadEvent) { var self = this; // @todo TinyMCE coupling @@ -65,13 +65,14 @@ // check for form changes if(self.is('.changed')) { - var msg = ss.i18n._t('LeftAndMain.CONFIRMUNSAVED'); // returned string will trigger a confirm() dialog, // but only if the method is triggered by an event - return (doConfirm) ? confirm(msg) : msg; + if(isUnloadEvent) { + return confirm(ss.i18n._t('LeftAndMain.CONFIRMUNSAVED')); + } else { + return ss.i18n._t('LeftAndMain.CONFIRMUNSAVEDSHORT'); + } } - - return null; }, /** diff --git a/javascript/lang/en_US.js b/javascript/lang/en_US.js index 8464316e..2a4b02de 100644 --- a/javascript/lang/en_US.js +++ b/javascript/lang/en_US.js @@ -24,6 +24,7 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') { 'ModelAdmin.DELETED': "Deleted", 'ModelAdmin.VALIDATIONERROR': "Validation Error", 'LeftAndMain.PAGEWASDELETED': "This page was deleted. To edit a page, select it from the left.", - 'LeftAndMain.CONFIRMUNSAVED': "Are you sure you want to navigate away from this page?\n\nWARNING: Your changes have not been saved.\n\nPress OK to continue, or Cancel to stay on the current page." + 'LeftAndMain.CONFIRMUNSAVED': "Are you sure you want to navigate away from this page?\n\nWARNING: Your changes have not been saved.\n\nPress OK to continue, or Cancel to stay on the current page.", + 'LeftAndMain.CONFIRMUNSAVEDSHORT': "WARNING: Your changes have not been saved." }); } \ No newline at end of file