From 70898430dc45ec3422ab2e05fc46054ba56a1909 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 24 Mar 2025 20:13:43 -0400 Subject: fixed iconifying collections to show image icon. fixed shortcut for using cached template. fixed onClick prop type --- src/fields/Doc.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fields') diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 4bf04da5c..803e4cac0 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -1154,9 +1154,9 @@ export namespace Doc { // the document containing the view layout information - will be the Document itself unless the Document has // a layout field or 'layout' is given. - export function Layout(doc: Doc, layout?: Doc): Doc { - const overrideLayout = layout && Cast(doc[layout.title + '(' + StrCast(layout.isTemplateForField, 'data') + ')'], Doc, null); - return overrideLayout || doc[DocLayout] || doc; + export function Layout(doc: Doc, template?: Doc): Doc { + const expandedTemplate = template && Cast(doc['layout_' + template.title + '(' + StrCast(template.isTemplateForField, 'data') + ')'], Doc, null); + return expandedTemplate || doc[DocLayout] || doc; } export function SetLayout(doc: Doc, layout: Doc | string) { doc[StrCast(doc.layout_fieldKey, 'layout')] = layout; -- cgit v1.2.3-70-g09d2