]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/code-editor.js
Merge pull request #3364 from BookStackApp/app_url_requests
[bookstack] / resources / js / components / code-editor.js
index a8a2c0c6f0ac793f0c36f7913533a148176a30f5..4ee3531c58a7da957079a7a9ffb6c46aaaaf9c4c 100644 (file)
@@ -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 `<li><button type="button" data-time="${key}">${localTime}</button></li>`;
+             return `<li><button type="button" data-time="${key}" class="text-item">${localTime}</button></li>`;
         }).join('');
     }