tree utils as a module

This commit is contained in:
azivner
2017-11-04 22:18:36 -04:00
parent 900f169dab
commit 30df3cba1c
10 changed files with 82 additions and 65 deletions

View File

@@ -4,7 +4,7 @@ const contextMenu = (function() {
const treeEl = $("#tree");
function pasteAfter(node) {
const subjectNode = getNodeByKey(noteTree.getClipboardNoteId());
const subjectNode = treeUtils.getNodeByKey(noteTree.getClipboardNoteId());
treeChanges.moveAfterNode(subjectNode, node);
@@ -12,7 +12,7 @@ const contextMenu = (function() {
}
function pasteInto(node) {
const subjectNode = getNodeByKey(noteTree.getClipboardNoteId());
const subjectNode = treeUtils.getNodeByKey(noteTree.getClipboardNoteId());
treeChanges.moveToNode(subjectNode, node);
@@ -56,8 +56,8 @@ const contextMenu = (function() {
const node = $.ui.fancytree.getNode(ui.target);
if (ui.cmd === "insertNoteHere") {
const parentKey = getParentKey(node);
const encryption = getParentEncryption(node);
const parentKey = treeUtils.getParentKey(node);
const encryption = treeUtils.getParentEncryption(node);
noteEditor.createNote(node, parentKey, 'after', encryption);
}