From 2a17392bd461bfdc669961c5bf8892b7cb6958d6 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 12 Mar 2021 17:49:35 -0500 Subject: trying to make treeViews more efficient by making fewer calls to Get document fields getter. --- src/client/views/collections/CollectionTreeView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/client/views/collections/CollectionTreeView.tsx') diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index a5194827e..525fa8ca1 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -192,7 +192,10 @@ export class CollectionTreeView extends CollectionSubView ; } - + @computed get treeViewtruncateTitleWidth() { return NumCast(this.doc.treeViewTruncateTitleWidth, this.panelWidth()); } + truncateTitleWidth = () => this.treeViewtruncateTitleWidth; + @computed get outlineMode() { return this.doc.treeViewType === "outline"; } + @computed get fileSysMode() { return this.doc.treeViewType === "fileSystem"; } onChildClick = () => this.props.onChildClick?.() || ScriptCast(this.doc.onChildClick); whenActiveChanged = (isActive: boolean) => { this.props.whenActiveChanged(this._isChildActive = isActive); }; active = (outsideReaction: boolean | undefined) => this.props.active(outsideReaction) || this._isChildActive; -- cgit v1.2.3-70-g09d2