mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 11:39:01 +01: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 | ||||
|             .requireLibrary(libraryLoader.MIND_ELIXIR) | ||||
|             .then(() => { | ||||
|                 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(); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|         super.doRender(); | ||||
|     async getData() { | ||||
|         const mind = this.mind; | ||||
|         if (!mind) { | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         return { | ||||
|             content: mind.getDataString() | ||||
|         }; | ||||
|     } | ||||
| 
 | ||||
|     async entitiesReloadedEvent({loadResults}) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran