From fc9e27c7b46b1d0b865e1ba759cd8ff20c71e0c5 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Thu, 9 Feb 2017 14:53:56 +0100 Subject: [PATCH] don't ask on unload unless document is dirty --- src/editor/modules/rng/rng.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor/modules/rng/rng.js b/src/editor/modules/rng/rng.js index fc8cd61..63bc2c2 100644 --- a/src/editor/modules/rng/rng.js +++ b/src/editor/modules/rng/rng.js @@ -231,9 +231,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 */ -- 2.20.1