From bf02d5f21b464d8277899912f7cae88cb0b51e0a Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sun, 29 Mar 2020 19:14:32 -0400 Subject: fixed makeTemplate to allow for nested templates --- src/client/util/DropConverter.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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 = 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]); -- cgit v1.2.3-70-g09d2