From 7740c0010944cfa215c9b21b113f030199ffab82 Mon Sep 17 00:00:00 2001 From: bob Date: Tue, 5 Feb 2019 12:18:52 -0500 Subject: naming changes --- src/views/collections/CollectionViewBase.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/views/collections/CollectionViewBase.tsx') diff --git a/src/views/collections/CollectionViewBase.tsx b/src/views/collections/CollectionViewBase.tsx index bfded71d9..76145f12b 100644 --- a/src/views/collections/CollectionViewBase.tsx +++ b/src/views/collections/CollectionViewBase.tsx @@ -9,11 +9,12 @@ import { ContextMenu } from "../ContextMenu"; import React = require("react"); import { DocumentView } from "../nodes/DocumentView"; import { CollectionDockingView } from "./CollectionDockingView"; +import { CollectionFreeFormDocumentView } from "../nodes/CollectionFreeFormDocumentView"; export interface CollectionViewProps { - fieldKey: Key; - Document: Document; + CollectionFieldKey: Key; + DocumentForCollection: Document; ContainingDocumentView: Opt; } @@ -22,9 +23,12 @@ export const COLLECTION_BORDER_WIDTH = 2; @observer export class CollectionViewBase extends React.Component { + public static LayoutString(collectionType: string) { + return `<${collectionType} DocumentForCollection={Document} CollectionFieldKey={DataKey} ContainingDocumentView={DocumentView}/>`; + } @computed public get active(): boolean { - var isSelected = (this.props.ContainingDocumentView != undefined && SelectionManager.IsSelected(this.props.ContainingDocumentView)); + 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 || @@ -34,14 +38,14 @@ export class CollectionViewBase extends React.Component { @action addDocument = (doc: Document): void => { //TODO This won't create the field if it doesn't already exist - const value = this.props.Document.GetFieldValue(this.props.fieldKey, ListField, new Array()) + const value = this.props.DocumentForCollection.GetFieldValue(this.props.CollectionFieldKey, ListField, new Array()) value.push(doc); } @action removeDocument = (doc: Document): void => { //TODO This won't create the field if it doesn't already exist - const value = this.props.Document.GetFieldValue(this.props.fieldKey, ListField, new Array()) + const value = this.props.DocumentForCollection.GetFieldValue(this.props.CollectionFieldKey, ListField, new Array()) if (value.indexOf(doc) !== -1) { value.splice(value.indexOf(doc), 1) -- cgit v1.2.3-70-g09d2