diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-03-29 19:14:32 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-03-29 19:14:32 -0400 |
commit | bf02d5f21b464d8277899912f7cae88cb0b51e0a (patch) | |
tree | 56291033842051f684c2f7e986e6837cf8db16d6 /src | |
parent | d9508fdc37e38eb62ef2b0aff76a9b5964f0f7a1 (diff) |
fixed makeTemplate to allow for nested templates
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/DropConverter.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/client/util/DropConverter.ts b/src/client/util/DropConverter.ts index a6a43d06a..d201934ea 100644 --- a/src/client/util/DropConverter.ts +++ b/src/client/util/DropConverter.ts @@ -15,6 +15,7 @@ import { ImageField } from "../../new_fields/URLField"; // after it has been converted to export function makeTemplate(doc: Doc, first: boolean = true, rename: Opt<string> = undefined): boolean { const layoutDoc = doc.layout instanceof Doc && doc.layout.isTemplateForField ? doc.layout : doc; + if (layoutDoc.layout instanceof Doc) return true; const layout = StrCast(layoutDoc.layout).match(/fieldKey={'[^']*'}/)![0]; const fieldKey = layout.replace("fieldKey={'", "").replace(/'}$/, ""); const docs = DocListCast(layoutDoc[fieldKey]); |