diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-03-28 01:00:30 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-03-28 01:00:30 -0400 |
commit | f488ca2b44af291c7bea853ad574cf7453fadb25 (patch) | |
tree | e4ccff15a75c68a97145359bb931e6914042d486 /src/new_fields/Doc.ts | |
parent | f80aee53be8582956a1f39519938700c3e90cb53 (diff) |
changed template parameters to be stored in '@params'. Updated ImageBox to allow template parameters
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 2a7b08d44..da723b43b 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -484,7 +484,9 @@ export namespace Doc { if (!targetDoc[expandedLayoutFieldKey]) { const newLayoutDoc = Doc.MakeDelegate(templateLayoutDoc, undefined, "[" + templateLayoutDoc.title + "]"); newLayoutDoc.expandedTemplate = targetDoc; - newLayoutDoc.params = templateParams?.match(/\(([a-zA-Z0-9_-]*)\)/)?.[1]; + // the template's parameters are stored in params which are derefenced to find + // the actual field key where the template data is stored. Currently this is only used in RichTextSchema's docView + newLayoutDoc["@params"] = templateParams?.match(/\(([a-zA-Z0-9_-]*)\)/)?.[1]; targetDoc[expandedLayoutFieldKey] = newLayoutDoc; const dataDoc = Doc.GetProto(targetDoc); newLayoutDoc.resolvedDataDoc = dataDoc; |