mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
if parent note is encrypted, then child note will be created as encrypted as well
This commit is contained in:
@@ -70,14 +70,19 @@ function getParentKey(node) {
|
||||
return (node.getParent() === null || node.getParent().key === "root_1") ? "root" : node.getParent().key;
|
||||
}
|
||||
|
||||
function getParentEncryption(node) {
|
||||
return node.getParent() === null ? 0 : node.getParent().data.encryption;
|
||||
}
|
||||
|
||||
const keybindings = {
|
||||
"insert": function(node) {
|
||||
const parentKey = getParentKey(node);
|
||||
const encryption = getParentEncryption(node);
|
||||
|
||||
createNote(node, parentKey, 'after');
|
||||
createNote(node, parentKey, 'after', encryption);
|
||||
},
|
||||
"ctrl+insert": function(node) {
|
||||
createNote(node, node.key, 'into');
|
||||
createNote(node, node.key, 'into', node.data.encryption);
|
||||
},
|
||||
"del": function(node) {
|
||||
deleteNode(node);
|
||||
@@ -329,9 +334,10 @@ $(function(){
|
||||
const node = $.ui.fancytree.getNode(ui.target);
|
||||
|
||||
if (ui.cmd === "insertNoteHere") {
|
||||
const parentKey = getParentKey(node);
|
||||
const parentKey = getParentKey(node);
|
||||
const encryption = getParentEncryption(node);
|
||||
|
||||
createNote(node, parentKey, 'after');
|
||||
createNote(node, parentKey, 'after', encryption);
|
||||
}
|
||||
else if (ui.cmd === "insertChildNote") {
|
||||
createNote(node, node.key, 'into');
|
||||
|
||||
Reference in New Issue
Block a user