diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-01-22 23:53:10 -0500 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-01-22 23:53:10 -0500 |
commit | 1348444b573ad7d50787b1c0a5aa46c1d267f9ef (patch) | |
tree | d185382c4ddf0878fce79a965dc08e99c336caf5 /src/new_fields/Doc.ts | |
parent | f970dd586c0914847b5a59951f586dad93a2cf04 (diff) |
small cleanups for exceptions
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 669e7a72f..4b7f10f91 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -467,12 +467,10 @@ export namespace Doc { return expandedTemplateLayout instanceof Doc ? expandedTemplateLayout : undefined; // layout is undefined if the expandedTemplate is pending. } - // returns the layout/data doc pair to render for the specified childDoc of a collection. - // The containerDoc is treated as a template if its containerDataDoc has a value. If so, - // the childDoc is treated as a layout description for some field of the container doc's data doc. + // if the childDoc is a template for a field, then this will return the expanded layout with its data doc. + // otherwise, it just returns the childDoc export function GetLayoutDataDocPair(containerDoc: Doc, containerDataDoc: Opt<Doc>, childDoc: Doc) { - const resolvedDataDoc = containerDoc.isTemplateForField || containerDataDoc === containerDoc || !containerDataDoc ? - undefined : Doc.GetDataDoc(containerDataDoc); + const resolvedDataDoc = containerDataDoc === containerDoc || !containerDataDoc ? undefined : Doc.GetDataDoc(containerDataDoc); return { layout: Doc.expandTemplateLayout(childDoc, resolvedDataDoc), data: resolvedDataDoc }; } |