mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
client: Save content of mind map
This commit is contained in:
parent
73c19c6cbf
commit
10df00d62f
@ -29,16 +29,35 @@ export default class MindMapWidget extends TypeWidget {
|
||||
libraryLoader
|
||||
.requireLibrary(libraryLoader.MIND_ELIXIR)
|
||||
.then(() => {
|
||||
const mind = new MindElixir({
|
||||
el: this.$content[0],
|
||||
direction: MindElixir.LEFT
|
||||
});
|
||||
mind.init(MindElixir.new());
|
||||
this.#onLibraryLoaded();
|
||||
});
|
||||
|
||||
super.doRender();
|
||||
}
|
||||
|
||||
#onLibraryLoaded() {
|
||||
const mind = new MindElixir({
|
||||
el: this.$content[0],
|
||||
direction: MindElixir.LEFT
|
||||
});
|
||||
this.mind = mind;
|
||||
mind.init(MindElixir.new());
|
||||
mind.bus.addListener("operation", (operation) => {
|
||||
this.spacedUpdate.scheduleUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
async getData() {
|
||||
const mind = this.mind;
|
||||
if (!mind) {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
content: mind.getDataString()
|
||||
};
|
||||
}
|
||||
|
||||
async entitiesReloadedEvent({loadResults}) {
|
||||
if (loadResults.isNoteReloaded(this.noteId)) {
|
||||
this.refresh();
|
||||
|
Loading…
x
Reference in New Issue
Block a user