aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2020-02-10 19:59:26 -0500
committerbob <bcz@cs.brown.edu>2020-02-10 19:59:26 -0500
commit3817c901191e73c8c141a52e202ded0fd12abf6c (patch)
tree09dd443b6594321899cda233769feaf71d4e307e /src/client/views/collections/CollectionStackingViewFieldColumn.tsx
parenta547bf10571c6e45f59fb8205171123da2560c75 (diff)
cleanup of summary docs. icons. carousel fwd/back
Diffstat (limited to 'src/client/views/collections/CollectionStackingViewFieldColumn.tsx')
-rw-r--r--src/client/views/collections/CollectionStackingViewFieldColumn.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
index 21982f1ca..3fc05c6b7 100644
--- a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
+++ b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
@@ -285,8 +285,10 @@ export class CollectionStackingViewFieldColumn extends React.Component<CSVFieldC
description: ":" + fieldKey, event: () => {
const created = Docs.Create.CarouselDocument([], { _width: 400, _height: 200, title: fieldKey });
if (created) {
- if (this.props.parent.Document.isTemplateDoc) {
- Doc.MakeMetadataFieldTemplate(created, this.props.parent.props.Document);
+ const container = this.props.parent.Document.resolvedDataDoc ? Doc.GetProto(this.props.parent.Document) : this.props.parent.Document;
+ if (container.isTemplateDoc) {
+ Doc.MakeMetadataFieldTemplate(created, container);
+ return Doc.AddDocToList(container, Doc.LayoutFieldKey(container), created);
}
return this.props.parent.props.addDocument(created);
}