encrypt and decrypt subtrees (in tree context menu)

This commit is contained in:
azivner
2017-09-17 12:46:14 -04:00
parent 52034e0cdc
commit d6ffae2035
3 changed files with 125 additions and 5 deletions
+6 -2
View File
@@ -149,6 +149,11 @@ function createNote(node, parentKey, target, encryption) {
});
}
function setTreeBasedOnEncryption(note) {
const node = getNodeByKey(note.detail.note_id);
node.toggleClass("encrypted", note.detail.encryption > 0);
}
function setNoteBackgroundIfEncrypted(note) {
if (note.detail.encryption > 0) {
$(".note-editable").addClass("encrypted");
@@ -161,8 +166,7 @@ function setNoteBackgroundIfEncrypted(note) {
$("#decryptButton").hide();
}
const node = getNodeByKey(note.detail.note_id);
node.toggleClass("encrypted", note.detail.encryption > 0);
setTreeBasedOnEncryption(note);
}
function loadNote(noteId) {