mirror of
https://github.com/zadam/trilium.git
synced 2025-02-23 06:26:31 +08:00
fix lost content data after CKEditor crash, closes #3584
This commit is contained in:
parent
cbabaa6b0c
commit
c95c5bb471
1 changed files with 13 additions and 7 deletions
|
@ -154,6 +154,19 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||
}
|
||||
});
|
||||
|
||||
await this.watchdog.setCreator(async (elementOrData, editorConfig) => {
|
||||
const editor = await BalloonEditor.create(elementOrData, editorConfig);
|
||||
|
||||
editor.model.document.on('change:data', () => this.spacedUpdate.scheduleUpdate());
|
||||
|
||||
if (glob.isDev && ENABLE_INSPECTOR) {
|
||||
await import(/* webpackIgnore: true */'../../../libraries/ckeditor/inspector.js');
|
||||
CKEditorInspector.attach(editor);
|
||||
}
|
||||
|
||||
return editor;
|
||||
});
|
||||
|
||||
await this.watchdog.create(this.$editor[0], {
|
||||
placeholder: "Type the content of your note here ...",
|
||||
mention: mentionSetup,
|
||||
|
@ -168,13 +181,6 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||
enablePreview: true // Enable preview view
|
||||
}
|
||||
});
|
||||
|
||||
this.watchdog.editor.model.document.on('change:data', () => this.spacedUpdate.scheduleUpdate());
|
||||
|
||||
if (glob.isDev && ENABLE_INSPECTOR) {
|
||||
await import(/* webpackIgnore: true */'../../../libraries/ckeditor/inspector.js');
|
||||
CKEditorInspector.attach(this.watchdog.editor);
|
||||
}
|
||||
}
|
||||
|
||||
async doRefresh(note) {
|
||||
|
|
Loading…
Reference in a new issue