diff options
author | bob <bcz@cs.brown.edu> | 2019-12-18 17:38:53 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-12-18 17:38:53 -0500 |
commit | 1b0a2af4e85ee38ff02c3d0e99179826173e0da4 (patch) | |
tree | 23b0e34b772a08450d7c9ea5f06af68f248ab9f3 | |
parent | 70f298e1a75ab5032ad197b5d329750aa1b8915c (diff) |
fix for note templates by fixing DocComponents' dataDoc method
-rw-r--r-- | src/client/views/DocComponent.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 7c8e130b5..4dbf26956 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -58,7 +58,7 @@ export function DocAnnotatableComponent<P extends DocAnnotatableProps, T>(schema //TODO This might be pretty inefficient if doc isn't observed, because computed doesn't cache then @computed get Document(): T { return schemaCtor(this.props.Document); } @computed get layoutDoc() { return Doc.Layout(this.props.Document); } - @computed get dataDoc() { return (this.props.DataDoc && this.props.Document.isTemplateField ? this.props.DataDoc : Doc.GetProto(this.props.Document)) as Doc; } + @computed get dataDoc() { return (this.props.DataDoc && (this.props.Document.isTemplateField || this.props.Document.isTemplateDoc) ? this.props.DataDoc : Doc.GetProto(this.props.Document)) as Doc; } @computed get extensionDoc() { return Doc.fieldExtensionDoc(this.dataDoc, this.props.fieldKey); } @computed get extensionDocSync() { return Doc.fieldExtensionDocSync(this.dataDoc, this.props.fieldKey); } @computed get annotationsKey() { return "annotations"; } |