From 3a079d9f21093327bcd69f3c512bc4e23dacd65d Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Mon, 16 Dec 2019 13:16:39 +0000 Subject: [PATCH] expand root by default, expand until there is more than one child --- webui/src/main/js/files.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webui/src/main/js/files.js b/webui/src/main/js/files.js index 3c413738..bbc19838 100644 --- a/webui/src/main/js/files.js +++ b/webui/src/main/js/files.js @@ -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)