aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-07-18 12:45:28 -0400
committerbob <bcz@cs.brown.edu>2019-07-18 12:45:28 -0400
commit5b69b2cba13f104471dc08e110148704fdc2acca (patch)
treea5a834e6c38f9365d3b73f6712b1ba63f13b367b /src/new_fields
parent123027bf525bfb6d635cf2304d01490bccb4abff (diff)
fixes for templating miniLayout and detailedLayouts
Diffstat (limited to 'src/new_fields')
-rw-r--r--src/new_fields/Doc.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index 769c6aa73..7180564ea 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -385,12 +385,12 @@ export namespace Doc {
export function MakeDelegate(doc: Doc, id?: string): Doc;
export function MakeDelegate(doc: Opt<Doc>, id?: string): Opt<Doc>;
export function MakeDelegate(doc: Opt<Doc>, id?: string): Opt<Doc> {
- if (!doc) {
- return undefined;
+ if (doc) {
+ const delegate = new Doc(id, true);
+ delegate.proto = doc;
+ return delegate;
}
- const delegate = new Doc(id, true);
- delegate.proto = doc;
- return delegate;
+ return undefined;
}
export function MakeTemplate(fieldTemplate: Doc, metaKey: string, proto: Doc) {