mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-04 06:31:35 +08:00
fix(mindmap): restore direction
This commit is contained in:
parent
0292489001
commit
fb0dda982f
@ -179,7 +179,6 @@ export default class MindMapWidget extends TypeWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#initLibrary();
|
|
||||||
await this.#loadData(note);
|
await this.#loadData(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,16 +190,18 @@ export default class MindMapWidget extends TypeWidget {
|
|||||||
const blob = await note.getBlob();
|
const blob = await note.getBlob();
|
||||||
const content = blob?.getJsonContent() || MindElixir.new(NEW_TOPIC_NAME);
|
const content = blob?.getJsonContent() || MindElixir.new(NEW_TOPIC_NAME);
|
||||||
|
|
||||||
if (this.mind) {
|
if (!this.mind) {
|
||||||
this.mind.refresh(content);
|
this.#initLibrary(content.direction ?? MindElixir.LEFT);
|
||||||
this.mind.toCenter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.mind.refresh(content);
|
||||||
|
this.mind.toCenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
#initLibrary() {
|
#initLibrary(direction: unknown) {
|
||||||
const mind = new MindElixir({
|
const mind = new MindElixir({
|
||||||
el: this.$content[0],
|
el: this.$content[0],
|
||||||
direction: MindElixir.LEFT
|
direction
|
||||||
});
|
});
|
||||||
mind.install(nodeMenu);
|
mind.install(nodeMenu);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user