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) {
const codeIsUpdated = request.codeIsUpdated !== false;
if (codeIsUpdated && editor && editor.isWarm() && !confirm(t('styleUpdateDiscardChanges'))) {
if (codeIsUpdated && editor && editor.isTouched() && !confirm(t('styleUpdateDiscardChanges'))) {
return;
}
doReplace();

View File

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