aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/TreeView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-08-19 02:22:38 -0400
committerbobzel <zzzman@gmail.com>2021-08-19 02:22:38 -0400
commit9f24c29df130ce4e206bc655ed7025e58c1517ce (patch)
treea8e375b101d2dd1a5075779c230b3bb7ee16675c /src/client/views/collections/TreeView.tsx
parent412ec3b38b2ee396b2709d824f02b0e417f5d967 (diff)
changed how treeview cycles between options for expanded views to show 'data' and some more adjustments.
Diffstat (limited to 'src/client/views/collections/TreeView.tsx')
-rw-r--r--src/client/views/collections/TreeView.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx
index 0598be49b..84b2fcef6 100644
--- a/src/client/views/collections/TreeView.tsx
+++ b/src/client/views/collections/TreeView.tsx
@@ -482,10 +482,11 @@ export class TreeView extends React.Component<TreeViewProps> {
const next = (modes: any[]) => modes[(modes.indexOf(StrCast(this.doc.treeViewExpandedView)) + 1) % modes.length];
const annos = () => DocListCast(this.doc[this.fieldKey + "-annotations"]).length ? "annotations" : "";
const links = () => DocListCast(this.doc.links).length ? "links" : "";
- const children = () => this.childDocs ? this.fieldKey : "";
- this.doc.treeViewExpandedView = next(this.props.treeView.fileSysMode ?
- (Doc.UserDoc().noviceMode ? ["layout", "aliases"] : ["layout", "aliases", "fields"]) :
- (Doc.UserDoc().noviceMode ? [children(), "layout"] : [children(), "fields", "layout", links(), annos()]).filter(mode => mode));
+ const data = () => this.childDocs && !this.props.treeView.dashboardMode ? this.fieldKey : "";
+ const aliases = () => this.props.treeView.dashboardMode ? "" : "aliases";
+ const fields = () => Doc.UserDoc().noviceMode ? "" : "fields";
+ const modes = [data(), "layout", ...(this.props.treeView.fileSysMode ? [aliases(), links(), annos()] : []), fields()];
+ this.doc.treeViewExpandedView = next(modes.filter(mode => mode));
}
this.treeViewOpen = true;
}