diff options
author | bob <bcz@cs.brown.edu> | 2020-01-28 15:15:47 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2020-01-28 15:15:47 -0500 |
commit | d1ed73e0a0fa3f3da9811edfe3233c663d34cffa (patch) | |
tree | 474b8dc7d9707c58d6fb06e642d8219c8f4fc0c5 /src/new_fields/Doc.ts | |
parent | 721c4b54aba58f68086d54e627389e7a36b7057d (diff) |
functional child templates for Buxton view
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 5ad8ad412..ca3aa0167 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -16,6 +16,7 @@ import { deleteProperty, getField, getter, makeEditable, makeReadOnly, setter, u import { intersectRect } from "../Utils"; import { UndoManager } from "../client/util/UndoManager"; import { computedFn } from "mobx-utils"; +import { RichTextField } from "./RichTextField"; export namespace Field { export function toKeyValueString(doc: Doc, key: string): string { @@ -610,6 +611,9 @@ export namespace Doc { Cast(templateField.data, listSpec(Doc), [])?.map(d => d instanceof Doc && MakeMetadataFieldTemplate(d, templateDoc)); (Doc.GetProto(templateField)[metadataFieldKey] = ObjectField.MakeCopy(templateField.data)); } + if (templateField.data instanceof RichTextField && templateField.data.Data) { + templateField._textTemplate = ObjectField.MakeCopy(templateField.data); + } // get the layout string that the template uses to specify its layout const templateFieldLayoutString = StrCast(Doc.LayoutField(Doc.Layout(templateField))); |