From d3ed4ced92dbfa0bf49ba16fe7057edfe8aa5a98 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 67cebbad..82a339de 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -1212,14 +1212,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