don't rebuild editor DOM on save, fixes #1380

This commit is contained in:
tophf 2022-01-10 17:57:46 +03:00
parent 51e56110e8
commit ba9d904ccc

View File

@ -108,9 +108,8 @@ function SectionsEditor() {
return; return;
} }
newStyle = await API.styles.editSave(newStyle); newStyle = await API.styles.editSave(newStyle);
destroyRemovedSections();
sessionStore.justEditedStyleId = newStyle.id; sessionStore.justEditedStyleId = newStyle.id;
editor.replaceStyle(newStyle, false); dirty.clear();
}, },
scrollToEditor(cm) { scrollToEditor(cm) {
@ -453,18 +452,6 @@ function SectionsEditor() {
return true; return true;
} }
function destroyRemovedSections() {
for (let i = 0; i < sections.length;) {
if (!sections[i].removed) {
i++;
continue;
}
sections[i].destroy();
sections[i].el.remove();
sections.splice(i, 1);
}
}
function updateMeta() { function updateMeta() {
$('#name').value = style.customName || style.name || ''; $('#name').value = style.customName || style.name || '';
$('#enabled').checked = style.enabled !== false; $('#enabled').checked = style.enabled !== false;