From d93bf05f6475686c315972749715f015f3967a89 Mon Sep 17 00:00:00 2001 From: eight Date: Thu, 9 Nov 2017 13:56:12 +0800 Subject: [PATCH] Fix: isWarm -> isTouched --- edit/edit.js | 2 +- edit/source-editor.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/edit/edit.js b/edit/edit.js index dee52754..6d4e4dae 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -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(); diff --git a/edit/source-editor.js b/edit/source-editor.js index ddd16dea..5aa37dbb 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -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 }; }