diff options
| author | Sam Wilkins <abdullah_ahmed@brown.edu> | 2019-04-13 19:14:42 -0400 |
|---|---|---|
| committer | Sam Wilkins <abdullah_ahmed@brown.edu> | 2019-04-13 19:14:42 -0400 |
| commit | 7a1a028d1d3f5602d39f559cb1614abda658a371 (patch) | |
| tree | 5de71b963a2e2e370818591f6e99fba868503ee0 /src/client/views/collections/CollectionBaseView.tsx | |
| parent | 35f09470b2939a6640b85c94a9a4ea2551a6ea42 (diff) | |
| parent | b7252aeacbbd73120bc6f80d551f4505646a883b (diff) | |
resolved merge conflicts with master
Diffstat (limited to 'src/client/views/collections/CollectionBaseView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionBaseView.tsx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/client/views/collections/CollectionBaseView.tsx b/src/client/views/collections/CollectionBaseView.tsx index 4380c8194..b5eaab349 100644 --- a/src/client/views/collections/CollectionBaseView.tsx +++ b/src/client/views/collections/CollectionBaseView.tsx @@ -32,19 +32,18 @@ export interface CollectionViewProps extends FieldViewProps { contentRef?: React.Ref<HTMLDivElement>; } -export const COLLECTION_BORDER_WIDTH = 1; @observer export class CollectionBaseView extends React.Component<CollectionViewProps> { - get collectionViewType(): CollectionViewType { + get collectionViewType(): CollectionViewType | undefined { let Document = this.props.Document; let viewField = Document.GetT(KeyStore.ViewType, NumberField); if (viewField === FieldWaiting) { - return CollectionViewType.Invalid; + return undefined; } else if (viewField) { return viewField.Data; } else { - return CollectionViewType.Freeform; + return CollectionViewType.Invalid; } } @@ -107,15 +106,18 @@ export class CollectionBaseView extends React.Component<CollectionViewProps> { const field = new ListField([doc]); // const script = CompileScript(` // if(added) { - // console.log("added " + field.Title); + // console.log("added " + field.Title + " " + doc.Title); // } else { - // console.log("removed " + field.Title); + // console.log("removed " + field.Title + " " + doc.Title); // } // `, { // addReturn: false, // params: { // field: Document.name, // added: "boolean" + // }, + // capturedVariables: { + // doc: this.props.Document // } // }); // if (script.compiled) { @@ -177,9 +179,10 @@ export class CollectionBaseView extends React.Component<CollectionViewProps> { active: this.active, onActiveChanged: this.onActiveChanged, }; + const viewtype = this.collectionViewType; return ( <div className={this.props.className || "collectionView-cont"} onContextMenu={this.props.onContextMenu} ref={this.props.contentRef}> - {this.props.children(this.collectionViewType, props)} + {viewtype !== undefined ? this.props.children(viewtype, props) : (null)} </div> ); } |
