mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	fix "show in full text search" in jump to note dialog
This commit is contained in:
		
							parent
							
								
									90d33f56c3
								
							
						
					
					
						commit
						4078b32e9d
					
				@ -47,10 +47,9 @@ function showInFullText(e) {
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
    e.stopPropagation();
 | 
			
		||||
 | 
			
		||||
    const searchText = $autoComplete.val();
 | 
			
		||||
    const searchString = $autoComplete.val();
 | 
			
		||||
 | 
			
		||||
    appContext.triggerCommand('showSearch', {searchText});
 | 
			
		||||
    appContext.triggerCommand('searchForResults', {searchText});
 | 
			
		||||
    appContext.triggerCommand('searchNotes', {searchString});
 | 
			
		||||
 | 
			
		||||
    $dialog.modal('hide');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -43,20 +43,21 @@ async function createSqlConsole() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** @return {NoteShort} */
 | 
			
		||||
async function createSearchNote(subTreeNoteId = null) {
 | 
			
		||||
async function createSearchNote(opts = {}) {
 | 
			
		||||
    const note = await server.post('search-note');
 | 
			
		||||
 | 
			
		||||
    if (subTreeNoteId) {
 | 
			
		||||
        await server.put(`notes/${note.noteId}/attributes`, [
 | 
			
		||||
            { type: 'label', name: 'subTreeNoteId', value: subTreeNoteId }
 | 
			
		||||
        ]);
 | 
			
		||||
    const attrsToUpdate = [
 | 
			
		||||
        opts.subTreeNoteId ? { type: 'label', name: 'subTreeNoteId', value: opts.subTreeNoteId } : undefined,
 | 
			
		||||
        opts.searchString ? { type: 'label', name: 'searchString', value: opts.searchString } : undefined
 | 
			
		||||
    ].filter(attr => !!attr);
 | 
			
		||||
 | 
			
		||||
    if (attrsToUpdate.length > 0) {
 | 
			
		||||
        await server.put(`notes/${note.noteId}/attributes`, attrsToUpdate);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    await ws.waitForMaxKnownEntityChangeId();
 | 
			
		||||
 | 
			
		||||
    const noteShort = await treeCache.getNote(note.noteId);
 | 
			
		||||
 | 
			
		||||
    return noteShort;
 | 
			
		||||
    return await treeCache.getNote(note.noteId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
 | 
			
		||||
@ -67,8 +67,8 @@ export default class DialogCommandExecutor extends Component {
 | 
			
		||||
        appContext.triggerCommand('focusOnDetail', {tabId: tabContext.tabId});
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async searchNotesCommand() {
 | 
			
		||||
        const searchNote = await dateNoteService.createSearchNote();
 | 
			
		||||
    async searchNotesCommand({searchString, subTreeNoteId}) {
 | 
			
		||||
        const searchNote = await dateNoteService.createSearchNote({searchString, subTreeNoteId});
 | 
			
		||||
 | 
			
		||||
        const tabContext = await appContext.tabManager.openTabWithNote(searchNote.noteId, true);
 | 
			
		||||
 | 
			
		||||
@ -78,11 +78,7 @@ export default class DialogCommandExecutor extends Component {
 | 
			
		||||
    async searchInSubtreeCommand({notePath}) {
 | 
			
		||||
        const noteId = treeService.getNoteIdFromNotePath(notePath);
 | 
			
		||||
 | 
			
		||||
        const searchNote = await dateNoteService.createSearchNote(noteId);
 | 
			
		||||
 | 
			
		||||
        const tabContext = await appContext.tabManager.openTabWithNote(searchNote.noteId, true);
 | 
			
		||||
 | 
			
		||||
        appContext.triggerCommand('focusOnSearchDefinition', {tabId: tabContext.tabId});
 | 
			
		||||
        this.searchNotesCommand({subTreeNoteId: noteId});
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    showBackendLogCommand() {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user