aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSubView.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-04-22 03:39:39 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-04-22 03:39:39 -0400
commit5a9e437bbd175b36a161e1d96c8ae873dfe6d105 (patch)
tree0f54896387bb601aa18ee0be511a6059400d17eb /src/client/views/collections/CollectionSubView.tsx
parent393d351420b3a0d28f4cd1ea8b674fa5d04bfcde (diff)
More
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
-rw-r--r--src/client/views/collections/CollectionSubView.tsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 3add288fd..1a839fdcb 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -20,6 +20,8 @@ import { CollectionPDFView } from "./CollectionPDFView";
import { CollectionVideoView } from "./CollectionVideoView";
import { Doc } from "../../../new_fields/Doc";
import { DocComponent } from "../DocComponent";
+import { listSpec } from "../../../new_fields/Schema";
+import { Cast } from "../../../new_fields/Types";
export interface CollectionViewProps extends FieldViewProps {
addDocument: (document: Doc, allowDuplicates?: boolean) => boolean;
@@ -50,6 +52,10 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
this.createDropTarget(ele);
}
+ get children() {
+ return Cast(this.props.Document[this.props.fieldKey], listSpec(Doc));
+ }
+
@action
protected setCursorPosition(position: [number, number]) {
let ind;