mirror of
https://github.com/zadam/trilium.git
synced 2024-12-28 19:04:02 +08:00
using globalTree consistently
This commit is contained in:
parent
b6007a25e8
commit
7bc322f9a1
2 changed files with 4 additions and 4 deletions
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue