From: Jan Szejko Date: Thu, 9 Feb 2017 13:48:46 +0000 (+0100) Subject: don't ask on unload unless document is dirty X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/ac08344e45e2d8f2aaa19fa022a279226117ce13?ds=sidebyside don't ask on unload unless document is dirty --- diff --git a/src/editor/modules/rng/rng.js b/src/editor/modules/rng/rng.js index c040d65..5b0fdb0 100644 --- a/src/editor/modules/rng/rng.js +++ b/src/editor/modules/rng/rng.js @@ -239,9 +239,9 @@ return function(sandbox) { var txt = gettext('Do you really want to exit?'); if(documentIsDirty) { txt += ' ' + gettext('Document contains unsaved changes!'); + event.returnValue = txt; // FF + return txt; // Chrome } - event.returnValue = txt; // FF - return txt; // Chrome }); /* api */