tree model: recursive setCollapsed

related to #64887
This commit is contained in:
Joao Moreno
2018-12-14 12:17:43 +01:00
parent 24ef48c895
commit 94ee300f6c
7 changed files with 76 additions and 57 deletions
+5
View File
@@ -26,6 +26,7 @@
<body>
<input type="text" id="filter" />
<button id="expandall">Expand All</button>
<button id="collapseall">Collapse All</button>
<button id="renderwidth">Render Width</button>
<button id="refresh">Refresh</button>
@@ -179,6 +180,7 @@
case '?problems': {
const { tree, treeFilter } = createIndexTree();
expandall.onclick = () => perf('expand all', () => tree.expandAll());
collapseall.onclick = () => perf('collapse all', () => tree.collapseAll());
renderwidth.onclick = () => perf('renderwidth', () => tree.layoutWidth(Math.random()));
@@ -199,6 +201,7 @@
case '?data': {
const { tree, treeFilter } = createAsyncDataTree();
expandall.onclick = () => perf('expand all', () => tree.expandAll());
collapseall.onclick = () => perf('collapse all', () => tree.collapseAll());
renderwidth.onclick = () => perf('renderwidth', () => tree.layoutWidth(Math.random()));
refresh.onclick = () => perf('refresh', () => tree.refresh(null, true));
@@ -210,6 +213,7 @@
case '?height': {
const { tree, treeFilter } = createIndexTree({ supportDynamicHeights: true });
expandall.onclick = () => perf('expand all', () => tree.expandAll());
collapseall.onclick = () => perf('collapse all', () => tree.collapseAll());
renderwidth.onclick = () => perf('renderwidth', () => tree.layoutWidth(Math.random()));
@@ -227,6 +231,7 @@
default: {
const { tree, treeFilter } = createIndexTree();
expandall.onclick = () => perf('expand all', () => tree.expandAll());
collapseall.onclick = () => perf('collapse all', () => tree.collapseAll());
renderwidth.onclick = () => perf('renderwidth', () => tree.layoutWidth(Math.random()));
+1 -1
View File
@@ -17,7 +17,7 @@ async function getTree(fsPath, level) {
const element = path.basename(fsPath);
const stat = await fs.stat(fsPath);
if (!stat.isDirectory() || element === '.git' || element === '.build' || level >= 2) {
if (!stat.isDirectory() || element === '.git' || element === '.build' || level >= 4) {
return { element };
}