Fix: should't edit the style object directly returned from getStyles cache

This commit is contained in:
eight 2017-09-14 09:09:40 +08:00
parent 97fd2aa083
commit b7b5888431

View File

@ -6,6 +6,9 @@
'use strict';
function createSourceEditor(style) {
// style might be an object reference to background page
style = deepCopy(style);
// draw HTML
$('#sections').innerHTML = '';
$('#name').disabled = true;
@ -271,7 +274,7 @@ function createSourceEditor(style) {
}
function replaceStyle(newStyle) {
style = newStyle;
style = deepCopy(newStyle);
updateMetas();
if (style.source !== cm.getValue()) {
const cursor = cm.getCursor();