From 799108e88074d7080ea0341153e73babf8faa7a5 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 30 Aug 2017 01:30:45 +0300 Subject: [PATCH] create code box in write-new-style editor immediately --- edit/edit.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/edit/edit.js b/edit/edit.js index 9c84b5b6..8435deb8 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -1242,14 +1242,11 @@ function init() { section[CssToProperty[i]] = [params[i]]; } } - window.onload = () => { - window.onload = null; - addSection(null, section); - editors[0].setOption('lint', CodeMirror.defaults.lint); - // default to enabled - $('#enabled').checked = true; - initHooks(); - }; + addSection(null, section); + editors[0].setOption('lint', CodeMirror.defaults.lint); + // default to enabled + $('#enabled').checked = true; + initHooks(); return; } // This is an edit