mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
Triggers full text search when Ctrl + Enter is pressed in autocomplete
This commit is contained in:
@@ -38,6 +38,16 @@ export default class JumpToNoteDialog extends BasicWidget {
|
||||
this.modal = bootstrap.Modal.getOrCreateInstance(this.$widget);
|
||||
|
||||
this.$autoComplete = this.$widget.find(".jump-to-note-autocomplete");
|
||||
this.$autoComplete.on('keydown', (event) => {
|
||||
if (event.ctrlKey && event.key === 'Enter') {
|
||||
// Prevent Ctrl + Enter from triggering autoComplete.
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
const searchString = this.$autoComplete.val();
|
||||
appContext.triggerCommand('searchNotes', { searchString });
|
||||
}
|
||||
|
||||
});
|
||||
this.$results = this.$widget.find(".jump-to-note-results");
|
||||
this.$showInFullTextButton = this.$widget.find(".show-in-full-text-button");
|
||||
this.$showInFullTextButton.on('click', e => this.showInFullText(e));
|
||||
|
||||
Reference in New Issue
Block a user