diff options
| author | bobzel <zzzman@gmail.com> | 2020-04-03 22:05:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-03 22:05:11 -0400 |
| commit | 5a49ff42f845239de72c4c31c4df0688313b30e7 (patch) | |
| tree | 082ea03501aecc4f9ea3f68d3954ef9b2c6195a8 /src/client/views/collections/CollectionSubView.tsx | |
| parent | a0e4ae65f81c62ac08761359e60b996f0e839559 (diff) | |
| parent | fac740378a9eeaeb0af4567f6402120aba8bd62e (diff) | |
Merge pull request #350 from browngraphicslab/search_doc
Search doc
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSubView.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index 70927cf22..d1d6ae3c1 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -34,6 +34,7 @@ export interface CollectionViewProps extends FieldViewProps { PanelHeight: () => number; VisibleHeight?: () => number; setPreviewCursor?: (func: (x: number, y: number, drag: boolean) => void) => void; + rootSelected: () => boolean; fieldKey: string; } @@ -95,6 +96,10 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?: this.props.Document.resolvedDataDoc ? this.props.Document : Doc.GetProto(this.props.Document)); // if the layout document has a resolvedDataDoc, then we don't want to get its parent which would be the unexpanded template } + rootSelected = () => { + return this.props.isSelected() || (this.props.Document.rootDocument || this.props.Document.forceActive ? this.props.rootSelected() : false); + } + // 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 // to its children which may be templates. |
