mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix lost content data after CKEditor crash, closes #3584
This commit is contained in:
parent
cbabaa6b0c
commit
c95c5bb471
@ -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], {
|
await this.watchdog.create(this.$editor[0], {
|
||||||
placeholder: "Type the content of your note here ...",
|
placeholder: "Type the content of your note here ...",
|
||||||
mention: mentionSetup,
|
mention: mentionSetup,
|
||||||
@ -168,13 +181,6 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
enablePreview: true // Enable preview view
|
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) {
|
async doRefresh(note) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user