From ba9d904ccc96cfc6b97356562fd96c38f20da058 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 10 Jan 2022 17:57:46 +0300 Subject: [PATCH] don't rebuild editor DOM on save, fixes #1380 --- edit/sections-editor.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) 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;