mirror of https://github.com/zlatinb/muwire
expand root by default, expand until there is more than one child
parent
ba0c85fe07
commit
3a079d9f21
|
@ -108,6 +108,7 @@ function initFiles() {
|
||||||
|
|
||||||
nodesById.set("root",root)
|
nodesById.set("root",root)
|
||||||
root.updateDiv()
|
root.updateDiv()
|
||||||
|
expand(root.nodeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
function encodedPathToRoot(node) {
|
function encodedPathToRoot(node) {
|
||||||
|
@ -167,6 +168,8 @@ function expand(nodeId) {
|
||||||
for (i = 0; i < node.children.length; i++) {
|
for (i = 0; i < node.children.length; i++) {
|
||||||
node.children[i].updateDiv()
|
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)
|
xmlhttp.open("GET", "/MuWire/Files?section=fileTree&path="+encodedPath, true)
|
||||||
|
|
Loading…
Reference in New Issue