mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 18:49:00 +01:00
feat(command_palette): display commands immediately
This commit is contained in:
parent
60e19de0d1
commit
126152ff63
@ -187,6 +187,12 @@ function showRecentNotes($el: JQuery<HTMLElement>) {
|
|||||||
$el.trigger("focus");
|
$el.trigger("focus");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showAllCommands($el: JQuery<HTMLElement>) {
|
||||||
|
searchDelay = 0;
|
||||||
|
$el.setSelectedNotePath("");
|
||||||
|
$el.autocomplete("val", ">").autocomplete("open");
|
||||||
|
}
|
||||||
|
|
||||||
function fullTextSearch($el: JQuery<HTMLElement>, options: Options) {
|
function fullTextSearch($el: JQuery<HTMLElement>, options: Options) {
|
||||||
const searchString = $el.autocomplete("val") as unknown as string;
|
const searchString = $el.autocomplete("val") as unknown as string;
|
||||||
if (options.fastSearch === false || searchString?.trim().length === 0) {
|
if (options.fastSearch === false || searchString?.trim().length === 0) {
|
||||||
@ -459,6 +465,7 @@ export default {
|
|||||||
autocompleteSourceForCKEditor,
|
autocompleteSourceForCKEditor,
|
||||||
initNoteAutocomplete,
|
initNoteAutocomplete,
|
||||||
showRecentNotes,
|
showRecentNotes,
|
||||||
|
showAllCommands,
|
||||||
setText,
|
setText,
|
||||||
init
|
init
|
||||||
};
|
};
|
||||||
|
|||||||
@ -124,11 +124,13 @@ export default class JumpToNoteDialog extends BasicWidget {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (commandMode) {
|
if (commandMode) {
|
||||||
// Start in command mode
|
// Start in command mode - manually trigger command search
|
||||||
this.$autoComplete
|
this.$autoComplete.autocomplete("val", ">");
|
||||||
.autocomplete("val", ">")
|
|
||||||
.trigger("focus")
|
// Manually populate with all commands immediately
|
||||||
.trigger("select");
|
noteAutocompleteService.showAllCommands(this.$autoComplete);
|
||||||
|
|
||||||
|
this.$autoComplete.trigger("focus");
|
||||||
} else {
|
} else {
|
||||||
// if you open the Jump To dialog soon after using it previously, it can often mean that you
|
// if you open the Jump To dialog soon after using it previously, it can often mean that you
|
||||||
// actually want to search for the same thing (e.g., you opened the wrong note at first try)
|
// actually want to search for the same thing (e.g., you opened the wrong note at first try)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user