From 7bc322f9a15b7858872d2abd0e63b5f1b1f4c084 Mon Sep 17 00:00:00 2001 From: azivner Date: Wed, 6 Sep 2017 21:34:54 -0400 Subject: [PATCH] using globalTree consistently --- static/js/note.js | 2 +- static/js/tree.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/note.js b/static/js/note.js index e09dd877e..77bcf525d 100644 --- a/static/js/note.js +++ b/static/js/note.js @@ -94,7 +94,7 @@ $(document).ready(function() { var globalNote; function createNewTopLevelNote() { - let rootNode = $("#tree").fancytree("getRootNode"); + let rootNode = globalTree.fancytree("getRootNode"); createNote(rootNode, "root", "into"); } diff --git a/static/js/tree.js b/static/js/tree.js index 48d811d42..546dc01a5 100644 --- a/static/js/tree.js +++ b/static/js/tree.js @@ -372,7 +372,7 @@ $("input[name=search]").keyup(function (e) { console.log("search: ", resp); // Pass a string to perform case insensitive matching - const tree = $("#tree").fancytree("getTree"); + const tree = globalTree.fancytree("getTree"); tree.filterBranches(function(node) { return resp.includes(node.data.note_id); }); @@ -383,12 +383,12 @@ $("input[name=search]").keyup(function (e) { $("button#btnResetSearch").click(function () { $("input[name=search]").val(""); - const tree = $("#tree").fancytree("getTree"); + const tree = globalTree.fancytree("getTree"); tree.clearFilter(); }); function collapseTree() { - $("#tree").fancytree("getRootNode").visit(function(node){ + globalTree.fancytree("getRootNode").visit(function(node){ node.setExpanded(false); }); }