mirror of
https://github.com/zadam/trilium.git
synced 2024-09-21 08:06:03 +08:00
fixing encrypt / decrypt subtree
This commit is contained in:
parent
705aff93ec
commit
b96e434345
|
@ -45,9 +45,6 @@ const contextMenu = (function() {
|
|||
treeEl.contextmenu("enableEntry", "pasteAfter", noteTree.getClipboardNoteTreeId() !== null);
|
||||
treeEl.contextmenu("enableEntry", "pasteInto", noteTree.getClipboardNoteTreeId() !== null);
|
||||
|
||||
treeEl.contextmenu("enableEntry", "protectSubTree", protected_session.isProtectedSessionAvailable());
|
||||
treeEl.contextmenu("enableEntry", "unprotectSubTree", protected_session.isProtectedSessionAvailable());
|
||||
|
||||
// Activate node on right-click
|
||||
node.setActive();
|
||||
// Disable tree keyboard handling
|
||||
|
@ -65,13 +62,13 @@ const contextMenu = (function() {
|
|||
noteEditor.createNote(node, parentNoteTreeId, 'after', isProtected);
|
||||
}
|
||||
else if (ui.cmd === "insertChildNote") {
|
||||
noteEditor.createNote(node, node.key, 'into');
|
||||
noteEditor.createNote(node, node.data.note_id, 'into');
|
||||
}
|
||||
else if (ui.cmd === "protectSubTree") {
|
||||
protected_session.protectSubTree(node.key, true);
|
||||
protected_session.protectSubTree(node.data.note_id, true);
|
||||
}
|
||||
else if (ui.cmd === "unprotectSubTree") {
|
||||
protected_session.protectSubTree(node.key, false);
|
||||
protected_session.protectSubTree(node.data.note_id, false);
|
||||
}
|
||||
else if (ui.cmd === "cut") {
|
||||
cut(node);
|
||||
|
|
|
@ -152,6 +152,8 @@ const protected_session = (function() {
|
|||
}
|
||||
|
||||
async function protectSubTree(noteId, protect) {
|
||||
await ensureProtectedSession(true, true);
|
||||
|
||||
await $.ajax({
|
||||
url: baseApiUrl + 'tree/' + noteId + "/protectSubTree/" + (protect ? 1 : 0),
|
||||
type: 'PUT',
|
||||
|
|
Loading…
Reference in a new issue