don't ask on unload unless document is dirty
authorJan Szejko <janek37@gmail.com>
Thu, 9 Feb 2017 13:48:46 +0000 (14:48 +0100)
committerJan Szejko <janek37@gmail.com>
Thu, 9 Feb 2017 13:48:46 +0000 (14:48 +0100)
src/editor/modules/rng/rng.js

index c040d65..5b0fdb0 100644 (file)
@@ -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 */