diff options
author | bob <bcz@cs.brown.edu> | 2019-06-26 14:05:34 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-06-26 14:05:34 -0400 |
commit | 43f998aa09d7df993b3c71dc2d4ae816c0deacf6 (patch) | |
tree | 94e948873b0f280f9da1ad9970d50f6fbcc64767 | |
parent | 084dd6d9b0ad51133025ba6bd2702fc44b1b6c31 (diff) |
fixed rendering of template-applied docs in freeform views.
-rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 6672b3a07..7ba6ecc44 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -296,6 +296,9 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) { getDocumentViewProps(layoutDoc: Doc): DocumentViewProps { let datadoc = BoolCast(this.props.Document.isTemplate) || this.props.DataDoc === this.props.Document ? undefined : this.props.DataDoc; + if (Cast(layoutDoc.layout, Doc) instanceof Doc) { // if this document is using a template to render, then set the dataDoc for the template to be this document + datadoc = layoutDoc; + } return { DataDoc: datadoc, Document: layoutDoc, |