diff options
| author | bob <bcz@cs.brown.edu> | 2019-02-19 16:11:31 -0500 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-02-19 16:11:31 -0500 |
| commit | b3c5cbe54eee7d234c2c3924ad018b95efd72243 (patch) | |
| tree | 638d69ab4bf310620cbb41d45dad9bb70b042b07 /src/client/views/collections/CollectionViewBase.tsx | |
| parent | 02f36f30593ba05cd3af166c17d30a67c69590c9 (diff) | |
got rid of DocumentView as a prop
Diffstat (limited to 'src/client/views/collections/CollectionViewBase.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionViewBase.tsx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx index 0a90bd0f2..0acc890d8 100644 --- a/src/client/views/collections/CollectionViewBase.tsx +++ b/src/client/views/collections/CollectionViewBase.tsx @@ -1,22 +1,17 @@ import { action, computed } from "mobx"; import { observer } from "mobx-react"; import { Document } from "../../../fields/Document"; -import { Opt } from "../../../fields/Field"; import { Key } from "../../../fields/Key"; import { ListField } from "../../../fields/ListField"; import { SelectionManager } from "../../util/SelectionManager"; import { ContextMenu } from "../ContextMenu"; import React = require("react"); -import { DocumentView } from "../nodes/DocumentView"; -import { CollectionDockingView } from "./CollectionDockingView"; -import { CollectionFreeFormDocumentView } from "../nodes/CollectionFreeFormDocumentView"; import { Transform } from "../../util/Transform"; export interface CollectionViewProps { fieldKey: Key; Document: Document; - ContainingDocumentView: Opt<DocumentView>; ScreenToLocalTransform: () => Transform; isSelected: () => boolean; isTopMost: boolean; @@ -32,12 +27,11 @@ export class CollectionViewBase extends React.Component<CollectionViewProps> { public static LayoutString(collectionType: string, fieldKey: string = "DataKey") { return `<${collectionType} Document={Document} ScreenToLocalTransform={ScreenToLocalTransform} fieldKey={${fieldKey}} isSelected={isSelected} select={select} - isTopMost={isTopMost} - ContainingDocumentView={DocumentView} BackgroundView={BackgroundView} />`; + isTopMost={isTopMost} BackgroundView={BackgroundView} />`; } @computed public get active(): boolean { - var isSelected = (this.props.ContainingDocumentView && SelectionManager.IsSelected(this.props.ContainingDocumentView)); + var isSelected = this.props.isSelected(); var childSelected = SelectionManager.SelectedDocuments().some(view => view.props.ContainingCollectionView == this); var topMost = this.props.isTopMost; return isSelected || childSelected || topMost; |
