basic lazy loading of tree now works, still WIP

This commit is contained in:
azivner
2018-04-16 20:40:18 -04:00
parent 1687ed7e0b
commit 82de1c88d4
6 changed files with 154 additions and 75 deletions

View File

@@ -285,14 +285,14 @@ async function treeInitialized() {
}
}
function initFancyTree(branch) {
utils.assertArguments(branch);
function initFancyTree(tree) {
utils.assertArguments(tree);
$tree.fancytree({
autoScroll: true,
keyboard: false, // we takover keyboard handling in the hotkeys plugin
extensions: ["hotkeys", "filter", "dnd", "clones"],
source: branch,
source: tree,
scrollParent: $tree,
click: (event, data) => {
const targetType = data.targetType;
@@ -375,7 +375,7 @@ async function loadTree() {
startNotePath = getNotePathFromAddress();
}
return await treeBuilder.prepareTree(resp.notes, resp.branches);
return await treeBuilder.prepareTree(resp.notes, resp.branches, resp.parentToChildren);
}
function collapseTree(node = null) {