diff options
author | bob <bcz@cs.brown.edu> | 2019-05-13 16:21:28 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-05-13 16:21:28 -0400 |
commit | 3be42131bc08024f06e0daec8d09e45bf3f1ddab (patch) | |
tree | 4ed0606fb7439f1b6c9f70b128f9e89f80ad5f4c /src/client/views/nodes/DocumentContentsView.tsx | |
parent | 48b0f98ea2519d861a0eecee541dc0986a2c2f12 (diff) |
a bunch of fixes to schemas, marquees, and an experimental feature to set a document's data with linking UI
Diffstat (limited to 'src/client/views/nodes/DocumentContentsView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentContentsView.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx index f404b7bc6..3ddf8eb00 100644 --- a/src/client/views/nodes/DocumentContentsView.tsx +++ b/src/client/views/nodes/DocumentContentsView.tsx @@ -43,9 +43,14 @@ const ObserverJsxParser: typeof JsxParser = ObserverJsxParser1 as any; export class DocumentContentsView extends React.Component<DocumentViewProps & { isSelected: () => boolean, select: (ctrl: boolean) => void, - layoutKey: string + layoutKey: string, }> { - @computed get layout(): string { return Cast(this.props.Document[this.props.layoutKey], "string", this.props.layoutKey === "layout" ? "<p>Error loading layout data</p>" : ""); } + @computed get layout(): string { + return StrCast(this.props.Document[this.props.layoutKey], + this.props.Document.data ? + "<FieldView {...props} fieldKey='data' />" : + KeyValueBox.LayoutString(this.props.Document.proto ? "proto" : "")); + } CreateBindings(): JsxBindings { return { props: OmitKeys(this.props, ['parentActive'], (obj: any) => obj.active = this.props.parentActive).omit }; |