mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 09:16:45 +01:00
note can be activated through 'keyboardShortcut' label
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import server from "./server.js";
|
||||
import utils from "./utils.js";
|
||||
import tree from "./tree.js";
|
||||
|
||||
class KeyboardAction {
|
||||
constructor(params) {
|
||||
@@ -33,6 +34,16 @@ const keyboardActionsLoaded = server.get('keyboard-actions').then(actions => {
|
||||
}
|
||||
});
|
||||
|
||||
server.get('keyboard-shortcuts-for-notes').then(shortcutForNotes => {
|
||||
for (const shortcut in shortcutForNotes) {
|
||||
utils.bindGlobalShortcut(shortcut, async () => {
|
||||
const treeService = (await import("./tree.js")).default;
|
||||
|
||||
treeService.activateNote(shortcutForNotes[shortcut]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function setGlobalActionHandler(actionName, handler) {
|
||||
keyboardActionsLoaded.then(() => {
|
||||
const action = keyboardActionRepo[actionName];
|
||||
|
||||
Reference in New Issue
Block a user