From f48c0da63f46c4dd8ad524506f40f9e6f1d8f5d5 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 10 Jun 2015 13:03:41 +0300 Subject: [PATCH] Editor: show an empty code box for styles with no sections --- edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edit.js b/edit.js index 5a239699..d38dfe96 100644 --- a/edit.js +++ b/edit.js @@ -773,7 +773,7 @@ function initWithStyle(style) { document.querySelectorAll("#sections > div").forEach(function(div) { div.parentNode.removeChild(div); }); - style.sections.forEach(function(section) { + (style.sections.length == 0 ? [{code: ""}] : style.sections).forEach(function(section) { setTimeout(function() { maximizeCodeHeight(addSection(null, section), editors.length == style.sections.length); }, 0);