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,14 +29,33 @@ export default class MindMapWidget extends TypeWidget {
|
|||||||
libraryLoader
|
libraryLoader
|
||||||
.requireLibrary(libraryLoader.MIND_ELIXIR)
|
.requireLibrary(libraryLoader.MIND_ELIXIR)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
this.#onLibraryLoaded();
|
||||||
|
});
|
||||||
|
|
||||||
|
super.doRender();
|
||||||
|
}
|
||||||
|
|
||||||
|
#onLibraryLoaded() {
|
||||||
const mind = new MindElixir({
|
const mind = new MindElixir({
|
||||||
el: this.$content[0],
|
el: this.$content[0],
|
||||||
direction: MindElixir.LEFT
|
direction: MindElixir.LEFT
|
||||||
});
|
});
|
||||||
|
this.mind = mind;
|
||||||
mind.init(MindElixir.new());
|
mind.init(MindElixir.new());
|
||||||
|
mind.bus.addListener("operation", (operation) => {
|
||||||
|
this.spacedUpdate.scheduleUpdate();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
super.doRender();
|
async getData() {
|
||||||
|
const mind = this.mind;
|
||||||
|
if (!mind) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
content: mind.getDataString()
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async entitiesReloadedEvent({loadResults}) {
|
async entitiesReloadedEvent({loadResults}) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user