From f488ca2b44af291c7bea853ad574cf7453fadb25 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sat, 28 Mar 2020 01:00:30 -0400 Subject: changed template parameters to be stored in '@params'. Updated ImageBox to allow template parameters --- src/new_fields/Doc.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/new_fields') 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; -- cgit v1.2.3-70-g09d2