diff options
author | bobzel <zzzman@gmail.com> | 2025-03-24 20:13:43 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-03-24 20:13:43 -0400 |
commit | 70898430dc45ec3422ab2e05fc46054ba56a1909 (patch) | |
tree | fdd949846e93f93f3342064f1302a3f427e20495 /src/fields/Doc.ts | |
parent | c1a474fd2cf633fa204f1bb6dce2539f4b172d6c (diff) |
fixed iconifying collections to show image icon. fixed shortcut for using cached template. fixed onClick prop type
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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; |