diff options
author | bobzel <zzzman@gmail.com> | 2019-09-20 15:11:30 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2019-09-20 15:11:30 -0400 |
commit | 6f7936d5c71bf3c802d73f47b19abe96c6d61848 (patch) | |
tree | 266d2f5f47bdde960656a5a14888b7bba09fac62 /src/new_fields/Doc.ts | |
parent | 2a003f69f8b5323c2a6b244332b1511df1ef0cc1 (diff) |
simplified script execution api a little. fixed dataDoc() related stuff in various Box's. fixed some template stuff.
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 0859cf41a..b875e7896 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -382,13 +382,13 @@ export namespace Doc { } // - // Resolves a reference to a field by returning 'doc' if field extension is specified, + // Resolves a reference to a field by returning 'doc' if no field extension is specified, // otherwise, it returns the extension document stored in doc.<fieldKey>_ext. // This mechanism allows any fields to be extended with an extension document that can // be used to capture field-specific metadata. For example, an image field can be extended // to store annotations, ink, and other data. // - export function resolvedFieldDataDoc(doc: Doc, fieldKey: string, fieldExt: string) { + export function fieldExtensionDoc(doc: Doc, fieldKey: string, fieldExt: string = "yes") { return fieldExt && doc[fieldKey + "_ext"] instanceof Doc ? doc[fieldKey + "_ext"] as Doc : doc; } @@ -477,7 +477,7 @@ export namespace Doc { let resolvedDataDoc = !doc.isTemplate && dataDoc !== doc && dataDoc ? Doc.GetDataDoc(dataDoc) : undefined; if (resolvedDataDoc && Doc.WillExpandTemplateLayout(childDocLayout, resolvedDataDoc)) { Doc.UpdateDocumentExtensionForField(resolvedDataDoc, fieldKey); - let fieldExtensionDoc = Doc.resolvedFieldDataDoc(resolvedDataDoc, StrCast(childDocLayout.templateField, StrCast(childDocLayout.title)), "dummy"); + let fieldExtensionDoc = Doc.fieldExtensionDoc(resolvedDataDoc, StrCast(childDocLayout.templateField, StrCast(childDocLayout.title)), "dummy"); layoutDoc = Doc.expandTemplateLayout(childDocLayout, fieldExtensionDoc !== resolvedDataDoc ? fieldExtensionDoc : undefined); } else layoutDoc = Doc.expandTemplateLayout(childDocLayout, resolvedDataDoc); return { layout: layoutDoc, data: resolvedDataDoc }; |