mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	noteId is now in the URL hash. When this is present during notecase startup, then this note will be loaded
This commit is contained in:
		
							parent
							
								
									e58b8e6c40
								
							
						
					
					
						commit
						2692ca14ca
					
				
							
								
								
									
										2
									
								
								TODO
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								TODO
									
									
									
									
									
								
							| @ -1,5 +1,7 @@ | ||||
| - when loading the app, open last viewed note | ||||
| - link to individual notes (and changing the URL to current one, probably through # anchor) | ||||
| - logout detection | ||||
| - conflict detection | ||||
| 
 | ||||
| Later: | ||||
| - drag and drop for notes (currently only keyboard) | ||||
|  | ||||
| @ -157,6 +157,8 @@ function loadNote(noteId) { | ||||
| 
 | ||||
|         $('#noteDetail').summernote('code', noteText); | ||||
| 
 | ||||
|         document.location.hash = noteId; | ||||
| 
 | ||||
|         $(window).resize(); // to trigger resizing of editor
 | ||||
| 
 | ||||
|         noteChangeDisabled = false; | ||||
|  | ||||
| @ -1,7 +1,11 @@ | ||||
| $(function(){ | ||||
|     $.get(baseUrl + 'tree').then(resp => { | ||||
|         const notes = resp.notes; | ||||
|         const startNoteId = resp.start_note_id; | ||||
|         let startNoteId = resp.start_note_id; | ||||
| 
 | ||||
|         if (document.location.hash) { | ||||
|             startNoteId = document.location.hash.substr(1); // strip initial #
 | ||||
|         } | ||||
| 
 | ||||
|         function copyTitle(notes) { | ||||
|             for (let note of notes) { | ||||
| @ -52,8 +56,6 @@ $(function(){ | ||||
|                 setExpanded(data.node.key, false); | ||||
|             }, | ||||
|             init: function(event, data) { | ||||
|                 console.log("Activating..."); | ||||
| 
 | ||||
|                 if (startNoteId) { | ||||
|                     data.tree.activateKey(startNoteId); | ||||
|                 } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner