From c918198a37e4ad5306b70a90ca1b3fcab2e28f76 Mon Sep 17 00:00:00 2001 From: geireann Date: Thu, 30 Nov 2023 16:00:13 -0500 Subject: fixed rootSelected prop to be optional. fixed fonticont toggle to pass 'self' even though it's deprecated. --- src/client/views/collections/CollectionMenu.tsx | 1 - src/client/views/collections/CollectionStackedTimeline.tsx | 1 - src/client/views/collections/CollectionStackingView.tsx | 2 +- src/client/views/collections/CollectionSubView.tsx | 4 ++-- src/client/views/collections/CollectionTreeView.tsx | 3 +-- src/client/views/collections/TabDocView.tsx | 2 -- src/client/views/collections/TreeView.tsx | 2 -- .../views/collections/collectionLinear/CollectionLinearView.tsx | 2 +- src/client/views/collections/collectionSchema/SchemaTableCell.tsx | 1 - 9 files changed, 5 insertions(+), 13 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx index 3c555e731..c3aba4754 100644 --- a/src/client/views/collections/CollectionMenu.tsx +++ b/src/client/views/collections/CollectionMenu.tsx @@ -102,7 +102,6 @@ export class CollectionMenu extends AntimodeMenu { dropAction="embed" setHeight={returnFalse} styleProvider={DefaultStyleProvider} - rootSelected={returnFalse} bringToFront={emptyFunction} select={emptyFunction} isContentActive={returnTrue} diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx index 552c19eb3..d4daf2baf 100644 --- a/src/client/views/collections/CollectionStackedTimeline.tsx +++ b/src/client/views/collections/CollectionStackedTimeline.tsx @@ -817,7 +817,6 @@ class StackedTimelineAnchor extends React.Component searchFilterDocs={returnEmptyDoclist} childFilters={returnEmptyFilter} childFiltersByRanges={returnEmptyFilter} - rootSelected={returnFalse} onClick={script} onDoubleClick={this.props.layoutDoc.autoPlayAnchors ? undefined : doublescript} ignoreAutoHeight={false} diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index 57ff7515e..582baa7b5 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -678,7 +678,7 @@ export class CollectionStackingView extends CollectionSubView(moreProps?: X) { } // this returns whether either the collection is selected, or the template that it is part of is selected - rootSelected = () => this.props.isSelected() || this.props.rootSelected(); + rootSelected = () => this.props.isSelected() || BoolCast(this.Document.rootDocument && this.props.rootSelected?.()); // The data field for rendering this collection will be on the this.props.Document unless we're rendering a template in which case we try to use props.DataDoc. // When a document has a DataDoc but it's not a template, then it contains its own rendering data, but needs to pass the DataDoc through diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index 5bd5cef25..36ea14d92 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -236,7 +236,6 @@ export class CollectionTreeView extends CollectionSubView { addDocTab={this.addDocTab} ScreenToLocalTransform={this.ScreenToLocalTransform} dontCenter={'y'} - rootSelected={returnFalse} whenChildContentsActiveChanged={this.whenChildContentActiveChanges} focus={this.focusFunc} docViewPath={returnEmptyDoclist} @@ -599,7 +598,6 @@ export class TabMinimapView extends React.Component { dontRegisterView={true} fieldKey={Doc.LayoutFieldKey(this.props.document)} bringToFront={emptyFunction} - rootSelected={returnFalse} addDocument={returnFalse} moveDocument={returnFalse} removeDocument={returnFalse} diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx index 03e82577e..ee5f9fd95 100644 --- a/src/client/views/collections/TreeView.tsx +++ b/src/client/views/collections/TreeView.tsx @@ -975,7 +975,6 @@ export class TreeView extends React.Component { treeViewDoc={this.props.treeView.props.Document} addDocument={undefined} addDocTab={this.props.addDocTab} - rootSelected={returnFalse} pinToPres={this.props.treeView.props.pinToPres} onClick={this.onChildClick} onDoubleClick={this.onChildDoubleClick} @@ -1081,7 +1080,6 @@ export class TreeView extends React.Component { ScreenToLocalTransform={this.docTransform} renderDepth={this.props.renderDepth + 1} treeViewDoc={this.props.treeView?.props.Document} - rootSelected={returnFalse} docViewPath={this.props.treeView.props.docViewPath} childFilters={returnEmptyFilter} childFiltersByRanges={returnEmptyFilter} diff --git a/src/client/views/collections/collectionLinear/CollectionLinearView.tsx b/src/client/views/collections/collectionLinear/CollectionLinearView.tsx index a06ed3a2d..96eabd88c 100644 --- a/src/client/views/collections/collectionLinear/CollectionLinearView.tsx +++ b/src/client/views/collections/collectionLinear/CollectionLinearView.tsx @@ -177,7 +177,7 @@ export class CollectionLinearView extends CollectionSubView() { addDocTab={this.props.addDocTab} pinToPres={emptyFunction} dragAction={(this.layoutDoc.childDragAction ?? this.props.childDragAction) as dropActionType} - rootSelected={this.props.isSelected} + rootSelected={this.rootSelected} removeDocument={this.props.removeDocument} ScreenToLocalTransform={docXf} PanelWidth={doc[Width]} diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx index 2c251d3cf..150b1b46e 100644 --- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx +++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx @@ -72,7 +72,6 @@ export class SchemaTableCell extends React.Component { searchFilterDocs: returnEmptyDoclist, styleProvider: DefaultStyleProvider, docViewPath: returnEmptyDoclist, - rootSelected: returnFalse, isSelected: returnFalse, setHeight: returnFalse, select: emptyFunction, -- cgit v1.2.3-70-g09d2