mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	scroll to current note in the tree
This commit is contained in:
		| @@ -38,6 +38,10 @@ | |||||||
|           <img src="stat/icons/list.png" alt="Collapse tree"/> |           <img src="stat/icons/list.png" alt="Collapse tree"/> | ||||||
|         </a> |         </a> | ||||||
|  |  | ||||||
|  |         <a onclick="scrollToCurrentNote()" title="Scroll to current note" class="icon-action"> | ||||||
|  |           <img src="stat/icons/crosshair.png" alt="Collapse tree"/> | ||||||
|  |         </a> | ||||||
|  |  | ||||||
|         <div id="tree"> |         <div id="tree"> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								static/icons/crosshair.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								static/icons/crosshair.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 463 B | 
| @@ -213,7 +213,7 @@ function decryptNoteAndSendToServer() { | |||||||
|  |  | ||||||
| function decryptNoteIfNecessary(note) { | function decryptNoteIfNecessary(note) { | ||||||
|     if (note.detail.encryption > 0) { |     if (note.detail.encryption > 0) { | ||||||
|         return decryptNote(note); |         decryptNote(note); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -179,4 +179,14 @@ function collapseTree() { | |||||||
|     }); |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function scrollToCurrentNote() { | ||||||
|  |     const node = getNodeByKey(globalCurrentNote.detail.note_id); | ||||||
|  |  | ||||||
|  |     if (node) { | ||||||
|  |         node.makeVisible({scrollIntoView: true}); | ||||||
|  |  | ||||||
|  |         node.setFocus(); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
| $(document).bind('keydown', 'alt+c', collapseTree); | $(document).bind('keydown', 'alt+c', collapseTree); | ||||||
		Reference in New Issue
	
	Block a user