]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/plugin-codeeditor.js
Added "page_include_parse" theme event
[bookstack] / resources / js / wysiwyg / plugin-codeeditor.js
index 82052a40d82bf167dda0f8577234c2145395c47d..b9fc355e1696a2a2692e4d8402c71c2b655085fe 100644 (file)
@@ -111,10 +111,8 @@ function defineCodeBlockCustomElement(editor) {
             const container = this.shadowRoot.querySelector('.CodeMirrorContainer');
             const renderCodeMirror = (Code) => {
                 this.cm = Code.wysiwygView(container, content, this.getLanguage());
-                Code.updateLayout(this.cm);
-                setTimeout(() => {
-                    this.style.height = null;
-                }, 1);
+                setTimeout(() => Code.updateLayout(this.cm), 10);
+                setTimeout(() => this.style.height = null, 12);
             };
 
             window.importVersioned('code').then((Code) => {