From 2388da7cfb42dff7762d14b699cb3b4da5eb98e7 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 16 Feb 2021 21:19:07 +0100 Subject: [PATCH] fixed "show in full search" click and keyboard shortcuts for collapse tree and scroll to active note actions, #1647 --- src/public/app/widgets/note_tree.js | 4 ++-- src/public/app/widgets/quick_search.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index 0a3ab3592..61e3651af 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -759,7 +759,7 @@ export default class NoteTreeWidget extends TabAwareWidget { await this.setExpandedStatusForSubtree(node, false); } - collapseTreeCommand() { this.collapseTree(); } + collapseTreeEvent() { this.collapseTree(); } /** * @return {FancytreeNode|null} @@ -783,7 +783,7 @@ export default class NoteTreeWidget extends TabAwareWidget { } } - async scrollToActiveNoteCommand() { + async scrollToActiveNoteEvent() { const activeContext = appContext.tabManager.getActiveTabContext(); if (activeContext && activeContext.notePath) { diff --git a/src/public/app/widgets/quick_search.js b/src/public/app/widgets/quick_search.js index 48740293f..e0a01e520 100644 --- a/src/public/app/widgets/quick_search.js +++ b/src/public/app/widgets/quick_search.js @@ -110,17 +110,21 @@ export default class QuickSearchWidget extends BasicWidget { this.$dropdownMenu.append($showInFullButton); - utils.bindElShortcut($showInFullButton, 'return', async () => { - const searchNote = await dateNotesService.createSearchNote({searchString: this.$searchString.val()}); + $showInFullButton.on('click', () => this.showInFullSearch()); - await appContext.tabManager.getActiveTabContext().setNote(searchNote.noteId); - }); + utils.bindElShortcut($showInFullButton, 'return', () => this.showInFullSearch()); utils.bindElShortcut(this.$dropdownMenu.find('.dropdown-item:first'), 'up', () => this.$searchString.focus()); this.$dropdownToggle.dropdown('update'); } + async showInFullSearch() { + const searchNote = await dateNotesService.createSearchNote({searchString: this.$searchString.val()}); + + await appContext.tabManager.getActiveTabContext().setNote(searchNote.noteId); + } + quickSearchEvent() { this.$searchString.focus(); }