mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 19:52:28 +08:00
fix(mindmap): regression on new mindmap
This commit is contained in:
parent
9820e8aa12
commit
b47dc13ff1
@ -196,19 +196,19 @@ export default class MindMapWidget extends TypeWidget {
|
|||||||
const content = blob?.getJsonContent<MindmapModel>();
|
const content = blob?.getJsonContent<MindmapModel>();
|
||||||
|
|
||||||
if (!this.mind) {
|
if (!this.mind) {
|
||||||
await this.#initLibrary(content?.direction ?? this.MindElixir.LEFT);
|
await this.#initLibrary(content?.direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mind.refresh(content ?? this.MindElixir.new(NEW_TOPIC_NAME));
|
this.mind.refresh(content ?? this.MindElixir.new(NEW_TOPIC_NAME));
|
||||||
this.mind.toCenter();
|
this.mind.toCenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
async #initLibrary(direction: unknown) {
|
async #initLibrary(direction?: number) {
|
||||||
this.MindElixir = (await import("mind-elixir")).default;
|
this.MindElixir = (await import("mind-elixir")).default;
|
||||||
|
|
||||||
const mind = new this.MindElixir({
|
const mind = new this.MindElixir({
|
||||||
el: this.$content[0],
|
el: this.$content[0],
|
||||||
direction
|
direction: direction ?? this.MindElixir.LEFT
|
||||||
});
|
});
|
||||||
mind.install(nodeMenu);
|
mind.install(nodeMenu);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user