change allowSearchNotes to allowJumpToSearchNotes

This commit is contained in:
SiriusXT 2024-11-24 13:11:57 +08:00
parent 1d1c7eb2ca
commit 836fa2deee
3 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ async function autocompleteSource(term, cb, options = {}) {
].concat(results); ].concat(results);
} }
if (term.trim().length >= 1 && options.allowSearchNotes) { if (term.trim().length >= 1 && options.allowJumpToSearchNotes) {
results = results.concat([ results = results.concat([
{ {
action: 'search-notes', action: 'search-notes',
@ -165,7 +165,7 @@ function initNoteAutocomplete($el, options) {
autocompleteOptions.debug = true; // don't close on blur autocompleteOptions.debug = true; // don't close on blur
} }
if (options.allowSearchNotes) { if (options.allowJumpToSearchNotes) {
$el.on('keydown', (event) => { $el.on('keydown', (event) => {
if (event.ctrlKey && event.key === 'Enter') { if (event.ctrlKey && event.key === 'Enter') {
// Prevent Ctrl + Enter from triggering autoComplete. // Prevent Ctrl + Enter from triggering autoComplete.

View File

@ -58,7 +58,7 @@ export default class JumpToNoteDialog extends BasicWidget {
noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, { noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, {
allowCreatingNotes: true, allowCreatingNotes: true,
hideGoToSelectedNoteButton: true, hideGoToSelectedNoteButton: true,
allowSearchNotes: true, allowJumpToSearchNotes: true,
container: this.$results container: this.$results
}) })
// clear any event listener added in previous invocation of this function // clear any event listener added in previous invocation of this function

View File

@ -70,7 +70,7 @@ export default class EmptyTypeWidget extends TypeWidget {
noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, { noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, {
hideGoToSelectedNoteButton: true, hideGoToSelectedNoteButton: true,
allowCreatingNotes: true, allowCreatingNotes: true,
allowSearchNotes: true, allowJumpToSearchNotes: true,
container: this.$results container: this.$results
}) })
.on('autocomplete:noteselected', function(event, suggestion, dataset) { .on('autocomplete:noteselected', function(event, suggestion, dataset) {