mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 19:52:28 +08:00
fix(rtl): wrong content when switching to an empty note
This commit is contained in:
parent
77d6cdc546
commit
a3a34cfab0
@ -492,21 +492,19 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
this.refreshIncludedNote(this.$editor, noteId);
|
this.refreshIncludedNote(this.$editor, noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async reinitialize(data = null) {
|
async reinitialize(data) {
|
||||||
if (!this.watchdog) {
|
if (!this.watchdog) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
data = this.watchdog.editor.getData();
|
|
||||||
}
|
|
||||||
this.watchdog.destroy();
|
this.watchdog.destroy();
|
||||||
await this.createEditor();
|
await this.createEditor();
|
||||||
this.watchdog.editor.setData(data);
|
this.watchdog.editor.setData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
async onLanguageChanged() {
|
async onLanguageChanged() {
|
||||||
await this.reinitialize();
|
const data = this.watchdog.editor.getData();
|
||||||
|
await this.reinitialize(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user