Fix: updateMetas -> updateMeta

This commit is contained in:
eight 2017-11-09 07:26:51 +08:00
parent 48e565079c
commit 0d06f32735

View File

@ -51,7 +51,7 @@ function createSourceEditor(style) {
editors.push(cm); editors.push(cm);
// draw metas info // draw metas info
updateMetas(); updateMeta();
initHooks(); initHooks();
initAppliesToLineWidget(); initAppliesToLineWidget();
@ -177,7 +177,7 @@ ${section}
} }
} }
function updateMetas() { function updateMeta() {
$('#name').value = style.name; $('#name').value = style.name;
$('#enabled').checked = style.enabled; $('#enabled').checked = style.enabled;
$('#url').href = style.url; $('#url').href = style.url;
@ -202,7 +202,7 @@ ${section}
history.replaceState({}, '', `?id=${newStyle.id}`); history.replaceState({}, '', `?id=${newStyle.id}`);
} }
style = deepCopy(newStyle); style = deepCopy(newStyle);
updateMetas(); updateMeta();
if (style.sourceCode !== cm.getValue()) { if (style.sourceCode !== cm.getValue()) {
const cursor = cm.getCursor(); const cursor = cm.getCursor();
cm.setValue(style.sourceCode); cm.setValue(style.sourceCode);
@ -216,7 +216,7 @@ ${section}
const value = !style.enabled; const value = !style.enabled;
dirty.modify('enabled', style.enabled, value); dirty.modify('enabled', style.enabled, value);
style.enabled = value; style.enabled = value;
updateMetas(); updateMeta();
// save when toggle enable state? // save when toggle enable state?
save(); save();
} }
@ -250,7 +250,7 @@ ${section}
function replaceMeta(newStyle) { function replaceMeta(newStyle) {
style.enabled = newStyle.enabled; style.enabled = newStyle.enabled;
dirty.clear('enabled'); dirty.clear('enabled');
updateMetas(); updateMeta();
} }
return { return {