From 858fa874aefa3f00cf8270cfcdd474522f83edbb Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 10 Oct 2020 00:21:22 +0300 Subject: [PATCH] don't fit to content on clicking the add button --- edit/sections-editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/edit/sections-editor.js b/edit/sections-editor.js index 19ce32c1..b6ef594b 100644 --- a/edit/sections-editor.js +++ b/edit/sections-editor.js @@ -568,7 +568,10 @@ function createSectionsEditor({style, onTitleChanged}) { container.appendChild(section.el); } section.cm[forceRefresh ? 'refresh' : 'refreshOnView'](); - fitToContent(section); + if (!base || init.code) { + // Fit a) during startup or b) when the clone button is clicked on a section with some code + fitToContent(section); + } updateSectionOrder(); section.onChange(updateLivePreview); updateLivePreview();