mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-23 06:35:43 +08:00
Improved WYSWYG editor code block layout update
To help prevent against empty areas during inital empty-cache loads. This delays the original layout update a little to give time for the layout to render as expected. For #3637
This commit is contained in:
parent
219da9da9b
commit
764489e30b
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user