mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-27 06:01:54 +03:00
Lexical: Linked up saving logic of editor via interface
This commit is contained in:
@ -118,7 +118,7 @@ export class PageEditor extends Component {
|
||||
async saveDraft() {
|
||||
const data = {name: this.titleElem.value.trim()};
|
||||
|
||||
const editorContent = this.getEditorComponent().getContent();
|
||||
const editorContent = await this.getEditorComponent().getContent();
|
||||
Object.assign(data, editorContent);
|
||||
|
||||
let didSave = false;
|
||||
@ -235,10 +235,12 @@ export class PageEditor extends Component {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MarkdownEditor|WysiwygEditor
|
||||
* @return {MarkdownEditor|WysiwygEditor|WysiwygEditorTinymce}
|
||||
*/
|
||||
getEditorComponent() {
|
||||
return window.$components.first('markdown-editor') || window.$components.first('wysiwyg-editor');
|
||||
return window.$components.first('markdown-editor')
|
||||
|| window.$components.first('wysiwyg-editor')
|
||||
|| window.$components.first('wysiwyg-editor-tinymce');
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user