0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-14 12:42:24 +00:00

Improved WYSIWYG code block behaviour via range of fixes

- Fixed issues with new code blocks breaking or acting odd due to
  misnamed contenteditable attribute.
- Helped fix issue where code blocks may show in a strage blank state
  due to timing within shadow dom loading.
- Fixed some function timing issues where some functions required their
  async predecessor to have finished.

Tested rather heavily in firefox and brave.
Fixes 
This commit is contained in:
Dan Brown 2022-02-27 17:18:08 +00:00
parent 06f694bad2
commit 0de4d6d223
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
2 changed files with 27 additions and 11 deletions
resources/js/components

View 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() {