mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	unified Jump-To and quick search behavior with regards to hoisting and opening in a new tab
This commit is contained in:
		| @@ -76,7 +76,10 @@ export default class RootCommandExecutor extends Component { | |||||||
|         // force immediate search |         // force immediate search | ||||||
|         await froca.loadSearchNote(searchNote.noteId); |         await froca.loadSearchNote(searchNote.noteId); | ||||||
|  |  | ||||||
|         const noteContext = await appContext.tabManager.openContextWithNote(searchNote.noteId, true); |         const activeNoteContext = appContext.tabManager.getActiveContext(); | ||||||
|  |         const hoistedNoteId = activeNoteContext?.hoistedNoteId || 'root'; | ||||||
|  |  | ||||||
|  |         const noteContext = await appContext.tabManager.openContextWithNote(searchNote.noteId, true, null, hoistedNoteId); | ||||||
|  |  | ||||||
|         appContext.triggerCommand('focusOnSearchDefinition', {ntxId: noteContext.ntxId}); |         appContext.triggerCommand('focusOnSearchDefinition', {ntxId: noteContext.ntxId}); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -206,7 +206,7 @@ export default class TabManager extends Component { | |||||||
|         await noteContext.setEmpty(); |         await noteContext.setEmpty(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     async openEmptyTab(ntxId, hoistedNoteId = 'root', mainNtxId = null) { |     async openEmptyTab(ntxId = null, hoistedNoteId = 'root', mainNtxId = null) { | ||||||
|         const noteContext = new NoteContext(ntxId, hoistedNoteId, mainNtxId); |         const noteContext = new NoteContext(ntxId, hoistedNoteId, mainNtxId); | ||||||
|  |  | ||||||
|         const existingNoteContext = this.children.find(nc => nc.ntxId === noteContext.ntxId); |         const existingNoteContext = this.children.find(nc => nc.ntxId === noteContext.ntxId); | ||||||
| @@ -240,7 +240,7 @@ export default class TabManager extends Component { | |||||||
|         return this.openContextWithNote(notePath, activate, null, hoistedNoteId); |         return this.openContextWithNote(notePath, activate, null, hoistedNoteId); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     async openContextWithNote(notePath, activate, ntxId, hoistedNoteId = 'root', mainNtxId = null) { |     async openContextWithNote(notePath, activate, ntxId = null, hoistedNoteId = 'root', mainNtxId = null) { | ||||||
|         const noteContext = await this.openEmptyTab(ntxId, hoistedNoteId, mainNtxId); |         const noteContext = await this.openEmptyTab(ntxId, hoistedNoteId, mainNtxId); | ||||||
|  |  | ||||||
|         if (notePath) { |         if (notePath) { | ||||||
|   | |||||||
| @@ -150,11 +150,9 @@ export default class QuickSearchWidget extends BasicWidget { | |||||||
|     async showInFullSearch() { |     async showInFullSearch() { | ||||||
|         this.$dropdownToggle.dropdown("hide"); |         this.$dropdownToggle.dropdown("hide"); | ||||||
|  |  | ||||||
|         const searchNote = await dateNotesService.createSearchNote({searchString: this.$searchString.val()}); |         await appContext.triggerCommand('searchNotes', { | ||||||
|  |             searchString: this.$searchString.val() | ||||||
|         await froca.loadSearchNote(searchNote.noteId); |         }); | ||||||
|  |  | ||||||
|         await appContext.tabManager.getActiveContext().setNote(searchNote.noteId); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     quickSearchEvent() { |     quickSearchEvent() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user