Fix: update live preview when the style is toggled/replaced

This commit is contained in:
eight 2019-02-02 16:43:47 +08:00
parent 93a15a8284
commit 02774a3b81

View File

@ -197,6 +197,7 @@ function createSectionsEditor({style, onTitleChanged}) {
dirty.modify('enabled', style.enabled, newValue); dirty.modify('enabled', style.enabled, newValue);
style.enabled = newValue; style.enabled = newValue;
enabledEl.checked = newValue; enabledEl.checked = newValue;
updateLivePreview();
} }
function nextEditor(cm, cycle = true) { function nextEditor(cm, cycle = true) {
@ -565,6 +566,7 @@ function createSectionsEditor({style, onTitleChanged}) {
$('#heading').textContent = t('editStyleHeading'); $('#heading').textContent = t('editStyleHeading');
} }
livePreview.show(Boolean(style.id)); livePreview.show(Boolean(style.id));
updateLivePreview();
}); });
function reinit() { function reinit() {