Fix: beforeunload warning

This commit is contained in:
eight 2017-09-13 16:56:04 +08:00
parent fa06b29748
commit b102aa0704
2 changed files with 2 additions and 2 deletions

View File

@ -597,7 +597,7 @@ window.onbeforeunload = () => {
rememberWindowSize(); rememberWindowSize();
} }
document.activeElement.blur(); document.activeElement.blur();
if (isCleanGlobal()) { if (isCleanGlobal() && (!editor || !editor.isDirty())) {
return; return;
} }
updateLintReportIfEnabled(null, 0); updateLintReportIfEnabled(null, 0);

View File

@ -138,5 +138,5 @@ function createSourceEditor(style) {
}); });
} }
return {replaceStyle, save, toggleStyle, updateStyleMeta}; return {replaceStyle, save, toggleStyle, updateStyleMeta, isDirty: dirty.isDirty};
} }