mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	scroll to current note in the tree
This commit is contained in:
		
							parent
							
								
									4e298d9d85
								
							
						
					
					
						commit
						fdc668e28b
					
				| @ -38,6 +38,10 @@ | ||||
|           <img src="stat/icons/list.png" alt="Collapse tree"/> | ||||
|         </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> | ||||
|       </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) { | ||||
|     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); | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner