mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02: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", "pasteAfter", noteTree.getClipboardNoteTreeId() !== null);
|
||||||
treeEl.contextmenu("enableEntry", "pasteInto", 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
|
// Activate node on right-click
|
||||||
node.setActive();
|
node.setActive();
|
||||||
// Disable tree keyboard handling
|
// Disable tree keyboard handling
|
||||||
@ -65,13 +62,13 @@ const contextMenu = (function() {
|
|||||||
noteEditor.createNote(node, parentNoteTreeId, 'after', isProtected);
|
noteEditor.createNote(node, parentNoteTreeId, 'after', isProtected);
|
||||||
}
|
}
|
||||||
else if (ui.cmd === "insertChildNote") {
|
else if (ui.cmd === "insertChildNote") {
|
||||||
noteEditor.createNote(node, node.key, 'into');
|
noteEditor.createNote(node, node.data.note_id, 'into');
|
||||||
}
|
}
|
||||||
else if (ui.cmd === "protectSubTree") {
|
else if (ui.cmd === "protectSubTree") {
|
||||||
protected_session.protectSubTree(node.key, true);
|
protected_session.protectSubTree(node.data.note_id, true);
|
||||||
}
|
}
|
||||||
else if (ui.cmd === "unprotectSubTree") {
|
else if (ui.cmd === "unprotectSubTree") {
|
||||||
protected_session.protectSubTree(node.key, false);
|
protected_session.protectSubTree(node.data.note_id, false);
|
||||||
}
|
}
|
||||||
else if (ui.cmd === "cut") {
|
else if (ui.cmd === "cut") {
|
||||||
cut(node);
|
cut(node);
|
||||||
|
@ -152,6 +152,8 @@ const protected_session = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function protectSubTree(noteId, protect) {
|
async function protectSubTree(noteId, protect) {
|
||||||
|
await ensureProtectedSession(true, true);
|
||||||
|
|
||||||
await $.ajax({
|
await $.ajax({
|
||||||
url: baseApiUrl + 'tree/' + noteId + "/protectSubTree/" + (protect ? 1 : 0),
|
url: baseApiUrl + 'tree/' + noteId + "/protectSubTree/" + (protect ? 1 : 0),
|
||||||
type: 'PUT',
|
type: 'PUT',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user