Просмотр исходного кода

Fix: move isClean into unbeforeunload handler

eight 8 лет назад
Родитель
Сommit
9a8c19b09b
1 измененных файлов с 7 добавлено и 7 удалено
  1. 7 7
      edit/edit.js

+ 7 - 7
edit/edit.js

@@ -582,15 +582,15 @@ window.onbeforeunload = () => {
   updateLintReportIfEnabled(null, 0);
   // neither confirm() nor custom messages work in modern browsers but just in case
   return t('styleChangesNotSaved');
-};
 
-function isClean() {
-  if (editor) {
-    return !editor.isDirty();
-  } else {
-    return isCleanGlobal();
+  function isClean() {
+    if (editor) {
+      return !editor.isDirty();
+    } else {
+      return isCleanGlobal();
+    }
   }
-}
+};
 
 function addAppliesTo(list, name, value) {
   const showingEverything = $('.applies-to-everything', list) !== null;