mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
global keyboard shortcuts for quick creating sub-notes under day note
This commit is contained in:
@@ -192,4 +192,22 @@ $(document).ready(() => {
|
||||
executeScript(script);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
if (isElectron()) {
|
||||
require('electron').ipcRenderer.on('create-sub-note', async function(event, message) {
|
||||
const {parentNoteId, content} = JSON.parse(message);
|
||||
|
||||
if (!noteTree.noteExists(parentNoteId)) {
|
||||
await noteTree.reload();
|
||||
}
|
||||
|
||||
await noteTree.activateNode(parentNoteId);
|
||||
|
||||
const node = noteTree.getCurrentNode();
|
||||
|
||||
await noteTree.createNote(node, node.data.noteId, 'into', node.data.isProtected);
|
||||
|
||||
setTimeout(() => noteEditor.setContent(content), 1000);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user