File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1+ import { kCodeMirror } from '@/js/consts' ;
12import { API } from '@/js/msg' ;
23import * as prefs from '@/js/prefs' ;
34import { sessionStore , t } from '@/js/util' ;
45import editor from './editor' ;
6+ import { helpPopup } from './util' ;
57
68window . on ( 'beforeunload' , e => {
79 let pos ;
@@ -33,7 +35,9 @@ window.on('beforeunload', e => {
3335 // refocus if unloading was canceled
3436 setTimeout ( ( ) => activeElement . focus ( ) ) ;
3537 }
36- if ( editor . dirty . isDirty ( ) ) {
38+ if ( editor . dirty . isDirty ( ) ||
39+ [ ] . some . call ( document . $$ ( helpPopup . SEL + ` .${ kCodeMirror } ` ) , el =>
40+ ! el [ kCodeMirror ] . isClean ( ) ) ) {
3741 // neither confirm() nor custom messages work in modern browsers but just in case
3842 e . returnValue = t ( 'styleChangesNotSaved' ) ;
3943 }
You can’t perform that action at this time.
0 commit comments