diff --git a/edit/sections-editor.js b/edit/sections-editor.js index deba1520..6326da8a 100644 --- a/edit/sections-editor.js +++ b/edit/sections-editor.js @@ -108,9 +108,8 @@ function SectionsEditor() { return; } newStyle = await API.styles.editSave(newStyle); - destroyRemovedSections(); sessionStore.justEditedStyleId = newStyle.id; - editor.replaceStyle(newStyle, false); + dirty.clear(); }, scrollToEditor(cm) { @@ -453,18 +452,6 @@ function SectionsEditor() { 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() { $('#name').value = style.customName || style.name || ''; $('#enabled').checked = style.enabled !== false;