mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	fix scrolling to the top of detail after switching note
This commit is contained in:
		| @@ -223,7 +223,7 @@ async function loadNoteDetail(noteId) { | ||||
|     treeService.setBranchBackgroundBasedOnProtectedStatus(noteId); | ||||
|  | ||||
|     // after loading new note make sure editor is scrolled to the top | ||||
|     $noteDetailWrapper.scrollTop(0); | ||||
|     getComponent(currentNote.type).scrollToTop(); | ||||
|  | ||||
|     $scriptArea.empty(); | ||||
|  | ||||
|   | ||||
| @@ -107,5 +107,6 @@ export default { | ||||
|         if (codeEditor) { | ||||
|             codeEditor.setValue(''); | ||||
|         } | ||||
|     } | ||||
|     }, | ||||
|     scrollToTop: () => $component.scrollTop(0) | ||||
| } | ||||
|   | ||||
| @@ -53,5 +53,6 @@ export default { | ||||
|     getContent: () => null, | ||||
|     focus: () => null, | ||||
|     onNoteChange: () => null, | ||||
|     cleanup: () => null | ||||
|     cleanup: () => null, | ||||
|     scrollToTop: () => null | ||||
| } | ||||
| @@ -71,5 +71,6 @@ export default { | ||||
|     getContent: () => null, | ||||
|     focus: () => null, | ||||
|     onNoteChange: () => null, | ||||
|     cleanup: () => null | ||||
|     cleanup: () => null, | ||||
|     scrollToTop: () => $component.scrollTop(0) | ||||
| } | ||||
| @@ -566,5 +566,6 @@ export default { | ||||
|     getContent: () => JSON.stringify(mapData), | ||||
|     focus: () => null, | ||||
|     onNoteChange: () => null, | ||||
|     cleanup | ||||
|     cleanup, | ||||
|     scrollToTop: () => null | ||||
| } | ||||
| @@ -37,5 +37,6 @@ export default { | ||||
|     getContent: () => "", | ||||
|     focus: () => null, | ||||
|     onNoteChange: () => null, | ||||
|     cleanup: () => $noteDetailRenderContent.empty() | ||||
|     cleanup: () => $noteDetailRenderContent.empty(), | ||||
|     scrollToTop: () => $component.scrollTop(0) | ||||
| } | ||||
| @@ -30,5 +30,6 @@ export default { | ||||
|     show, | ||||
|     focus: () => null, | ||||
|     onNoteChange: () => null, | ||||
|     cleanup: () => null | ||||
|     cleanup: () => null, | ||||
|     scrollToTop: () => null | ||||
| } | ||||
| @@ -74,5 +74,6 @@ export default { | ||||
|         if (textEditor) { | ||||
|             textEditor.setData(''); | ||||
|         } | ||||
|     } | ||||
|     }, | ||||
|     scrollToTop: () => $component.scrollTop(0) | ||||
| } | ||||
		Reference in New Issue
	
	Block a user