diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2019-06-25 20:18:06 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2019-06-25 20:18:06 -0400 |
| commit | 46c51661acb042ed2779d26a6a8305ec15bec25b (patch) | |
| tree | 233a8b24f3b64b3a1a7613c5d3fcc330fbc96fdb /src/client/views/collections/CollectionSubView.tsx | |
| parent | e49fa36db6eab77bcd89c48969f555ae0579aa9a (diff) | |
cleaned up version of templates with annotations.
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSubView.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index caf6aa0c9..1b1f765ed 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -45,13 +45,15 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) { this.createDropTarget(ele); } + @computed get dataDoc() { return this.props.DataDoc && BoolCast(this.props.Document.isTemplate) ? this.props.DataDoc : this.props.Document; } @computed get extDoc() { - return this.props.DataDoc && this.props.fieldExt && this.props.DataDoc[this.props.fieldKey + "_ext"] instanceof Doc ? this.props.DataDoc[this.props.fieldKey + "_ext"] as Doc : this.props.DataDoc; + return Doc.extDoc(this.dataDoc, this.props.fieldKey, this.props.fieldExt); } @computed get extField() { - return this.props.DataDoc && this.props.fieldExt && this.props.DataDoc[this.props.fieldKey + "_ext"] instanceof Doc ? this.props.fieldExt : this.props.fieldKey; + return Doc.extField(this.dataDoc, this.props.fieldKey, this.props.fieldExt); } + get childDocs() { //TODO tfs: This might not be what we want? //This linter error can't be fixed because of how js arguments work, so don't switch this to filter(FieldValue) |
