expand root by default, expand until there is more than one child

pull/34/head
Zlatin Balevsky 2019-12-16 13:16:39 +00:00
parent ba0c85fe07
commit 3a079d9f21
1 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,7 @@ function initFiles() {
nodesById.set("root",root)
root.updateDiv()
expand(root.nodeId)
}
function encodedPathToRoot(node) {
@ -167,6 +168,8 @@ function expand(nodeId) {
for (i = 0; i < node.children.length; i++) {
node.children[i].updateDiv()
}
if (node.children.length == 1 && !node.children[0].leaf)
expand(node.children[0].nodeId)
}
}
xmlhttp.open("GET", "/MuWire/Files?section=fileTree&path="+encodedPath, true)