using globalTree consistently

This commit is contained in:
azivner 2017-09-06 21:34:54 -04:00
parent b6007a25e8
commit 7bc322f9a1
2 changed files with 4 additions and 4 deletions

View file

@ -94,7 +94,7 @@ $(document).ready(function() {
var globalNote; var globalNote;
function createNewTopLevelNote() { function createNewTopLevelNote() {
let rootNode = $("#tree").fancytree("getRootNode"); let rootNode = globalTree.fancytree("getRootNode");
createNote(rootNode, "root", "into"); createNote(rootNode, "root", "into");
} }

View file

@ -372,7 +372,7 @@ $("input[name=search]").keyup(function (e) {
console.log("search: ", resp); console.log("search: ", resp);
// Pass a string to perform case insensitive matching // Pass a string to perform case insensitive matching
const tree = $("#tree").fancytree("getTree"); const tree = globalTree.fancytree("getTree");
tree.filterBranches(function(node) { tree.filterBranches(function(node) {
return resp.includes(node.data.note_id); return resp.includes(node.data.note_id);
}); });
@ -383,12 +383,12 @@ $("input[name=search]").keyup(function (e) {
$("button#btnResetSearch").click(function () { $("button#btnResetSearch").click(function () {
$("input[name=search]").val(""); $("input[name=search]").val("");
const tree = $("#tree").fancytree("getTree"); const tree = globalTree.fancytree("getTree");
tree.clearFilter(); tree.clearFilter();
}); });
function collapseTree() { function collapseTree() {
$("#tree").fancytree("getRootNode").visit(function(node){ globalTree.fancytree("getRootNode").visit(function(node){
node.setExpanded(false); node.setExpanded(false);
}); });
} }