Fix: isWarm -> isTouched

This commit is contained in:
eight 2017-11-09 13:56:12 +08:00
parent 6d411c01fc
commit d93bf05f64
2 changed files with 4 additions and 4 deletions

View File

@ -1894,7 +1894,7 @@ chrome.runtime.onMessage.addListener(onRuntimeMessage);
function replaceStyle(request) { function replaceStyle(request) {
const codeIsUpdated = request.codeIsUpdated !== false; const codeIsUpdated = request.codeIsUpdated !== false;
if (codeIsUpdated && editor && editor.isWarm() && !confirm(t('styleUpdateDiscardChanges'))) { if (codeIsUpdated && editor && editor.isTouched() && !confirm(t('styleUpdateDiscardChanges'))) {
return; return;
} }
doReplace(); doReplace();

View File

@ -6,7 +6,7 @@
'use strict'; 'use strict';
function createSourceEditor(style) { function createSourceEditor(style) {
// a flag for isWarm() // a flag for isTouched()
let hadBeenSaved = false; let hadBeenSaved = false;
// draw HTML // draw HTML
@ -242,7 +242,7 @@ ${section}
}); });
} }
function isWarm() { function isTouched() {
// indicate that the editor had been touched by the user // indicate that the editor had been touched by the user
return dirty.isDirty() || hadBeenSaved; return dirty.isDirty() || hadBeenSaved;
} }
@ -260,6 +260,6 @@ ${section}
toggleStyle, toggleStyle,
isDirty: dirty.isDirty, isDirty: dirty.isDirty,
getStyle: () => style, getStyle: () => style,
isWarm isTouched
}; };
} }