From 836fa2deeeb251fbbaa1f9d9efc58cde40bde946 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Sun, 24 Nov 2024 13:11:57 +0800 Subject: [PATCH] change allowSearchNotes to allowJumpToSearchNotes --- src/public/app/services/note_autocomplete.js | 4 ++-- src/public/app/widgets/dialogs/jump_to_note.js | 2 +- src/public/app/widgets/type_widgets/empty.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/public/app/services/note_autocomplete.js b/src/public/app/services/note_autocomplete.js index 91e003c7b..69e098a4a 100644 --- a/src/public/app/services/note_autocomplete.js +++ b/src/public/app/services/note_autocomplete.js @@ -44,7 +44,7 @@ async function autocompleteSource(term, cb, options = {}) { ].concat(results); } - if (term.trim().length >= 1 && options.allowSearchNotes) { + if (term.trim().length >= 1 && options.allowJumpToSearchNotes) { results = results.concat([ { action: 'search-notes', @@ -165,7 +165,7 @@ function initNoteAutocomplete($el, options) { autocompleteOptions.debug = true; // don't close on blur } - if (options.allowSearchNotes) { + if (options.allowJumpToSearchNotes) { $el.on('keydown', (event) => { if (event.ctrlKey && event.key === 'Enter') { // Prevent Ctrl + Enter from triggering autoComplete. diff --git a/src/public/app/widgets/dialogs/jump_to_note.js b/src/public/app/widgets/dialogs/jump_to_note.js index ff4c4939b..75cd6b94a 100644 --- a/src/public/app/widgets/dialogs/jump_to_note.js +++ b/src/public/app/widgets/dialogs/jump_to_note.js @@ -58,7 +58,7 @@ export default class JumpToNoteDialog extends BasicWidget { noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, { allowCreatingNotes: true, hideGoToSelectedNoteButton: true, - allowSearchNotes: true, + allowJumpToSearchNotes: true, container: this.$results }) // clear any event listener added in previous invocation of this function diff --git a/src/public/app/widgets/type_widgets/empty.js b/src/public/app/widgets/type_widgets/empty.js index 24d60b4fb..abec94ab5 100644 --- a/src/public/app/widgets/type_widgets/empty.js +++ b/src/public/app/widgets/type_widgets/empty.js @@ -70,7 +70,7 @@ export default class EmptyTypeWidget extends TypeWidget { noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, { hideGoToSelectedNoteButton: true, allowCreatingNotes: true, - allowSearchNotes: true, + allowJumpToSearchNotes: true, container: this.$results }) .on('autocomplete:noteselected', function(event, suggestion, dataset) {