X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c6ad16dba657c82512ae495a4a38b99b8cfa9eeb..refs/pull/3433/head:/resources/js/components/code-editor.js diff --git a/resources/js/components/code-editor.js b/resources/js/components/code-editor.js index a8a2c0c6f..4ee3531c5 100644 --- a/resources/js/components/code-editor.js +++ b/resources/js/components/code-editor.js @@ -59,12 +59,10 @@ class CodeEditor { this.languageInput.value = language; this.callback = callback; - this.show(); - this.updateEditorMode(language); - - window.importVersioned('code').then(Code => { - Code.setContent(this.editor, code); - }); + this.show() + .then(() => this.updateEditorMode(language)) + .then(() => window.importVersioned('code')) + .then(Code => Code.setContent(this.editor, code)); } async show() { @@ -98,7 +96,7 @@ class CodeEditor { this.historyDropDown.classList.toggle('hidden', historyKeys.length === 0); this.historyList.innerHTML = historyKeys.map(key => { const localTime = (new Date(parseInt(key))).toLocaleTimeString(); - return `
`; + return ``; }).join(''); }