diff options
| author | Monika Hedman <monika_hedman@brown.edu> | 2019-02-13 15:35:02 -0500 |
|---|---|---|
| committer | Monika Hedman <monika_hedman@brown.edu> | 2019-02-13 15:35:02 -0500 |
| commit | e6ac9cd0a870f857822929f0efe28f5aeb50711a (patch) | |
| tree | 929374bb1f92ddd83f35200be1147f5b7185a65d /src/client/views/collections/CollectionViewBase.tsx | |
| parent | a0430a981cd5996f3b3be60ed12f37f4fed235ae (diff) | |
| parent | c93c3e1970c6ecc91b60f1782e82b1bfdc7fef30 (diff) | |
Merge branch 'transforms' of https://github.com/browngraphicslab/Dash-Web into hedmanLocal
Diffstat (limited to 'src/client/views/collections/CollectionViewBase.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionViewBase.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx index a41196027..2c950c8ae 100644 --- a/src/client/views/collections/CollectionViewBase.tsx +++ b/src/client/views/collections/CollectionViewBase.tsx @@ -18,6 +18,9 @@ export interface CollectionViewProps { DocumentForCollection: Document; ContainingDocumentView: Opt<DocumentView>; GetTransform: () => Transform; + isSelected: () => boolean; + isTopMost: boolean; + select: (ctrlPressed: boolean) => void; BackgroundView: Opt<DocumentView>; Scaling: number; } @@ -28,17 +31,16 @@ export const COLLECTION_BORDER_WIDTH = 2; export class CollectionViewBase extends React.Component<CollectionViewProps> { public static LayoutString(collectionType: string, fieldKey: string = "DataKey") { - return `<${collectionType} DocumentForCollection={Document} CollectionFieldKey={${fieldKey}} - GetTransform={GetTransform} - ContainingDocumentView={DocumentView}/>`; + return `<${collectionType} Scaling={Scaling} DocumentForCollection={Document} + GetTransform={GetTransform} CollectionFieldKey={${fieldKey}} isSelected={isSelected} select={select} + isTopMost={isTopMost} + ContainingDocumentView={DocumentView} BackgroundView={BackgroundView} />`; } @computed public get active(): boolean { var isSelected = (this.props.ContainingDocumentView instanceof CollectionFreeFormDocumentView && SelectionManager.IsSelected(this.props.ContainingDocumentView)); var childSelected = SelectionManager.SelectedDocuments().some(view => view.props.ContainingCollectionView == this); - var topMost = this.props.ContainingDocumentView != undefined && ( - this.props.ContainingDocumentView.props.ContainingCollectionView == undefined || - this.props.ContainingDocumentView.props.ContainingCollectionView instanceof CollectionDockingView); + var topMost = this.props.isTopMost; return isSelected || childSelected || topMost; } @action |
