diff options
author | madelinegr <mgriswold99@gmail.com> | 2019-02-25 17:33:05 -0500 |
---|---|---|
committer | madelinegr <mgriswold99@gmail.com> | 2019-02-25 17:33:05 -0500 |
commit | dfe69e008b073a5c1dace2dc047e6696318e4720 (patch) | |
tree | 522d81c60a0411d79f599ba73b068b5ecda7364f /src/client/views/nodes/FieldView.tsx | |
parent | d091617fa9a8c43914fb754ca170cb3b2750d1af (diff) | |
parent | bb418216efa9cc2e191b970e4cbe5080f4fd2b87 (diff) |
mer con
Diffstat (limited to 'src/client/views/nodes/FieldView.tsx')
-rw-r--r-- | src/client/views/nodes/FieldView.tsx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx index df6a409ec..368ad049d 100644 --- a/src/client/views/nodes/FieldView.tsx +++ b/src/client/views/nodes/FieldView.tsx @@ -11,8 +11,13 @@ import { WebField } from "../../../fields/WebField"; import { Key } from "../../../fields/Key"; import { FormattedTextBox } from "./FormattedTextBox"; import { ImageBox } from "./ImageBox"; +<<<<<<< HEAD import { WebBox } from "./WebBox"; import { DocumentView } from "./DocumentView"; +======= +import { HtmlField } from "../../../fields/HtmlField"; +import { WebView } from "./WebView"; +>>>>>>> bb418216efa9cc2e191b970e4cbe5080f4fd2b87 // // these properties get assigned through the render() method of the DocumentView when it creates this node. @@ -22,12 +27,16 @@ import { DocumentView } from "./DocumentView"; export interface FieldViewProps { fieldKey: Key; doc: Document; - DocumentViewForField: Opt<DocumentView> + isSelected: () => boolean; + select: () => void; + isTopMost: boolean; + bindings: any; } @observer export class FieldView extends React.Component<FieldViewProps> { - public static LayoutString(fieldType: string) { return `<${fieldType} doc={Document} DocumentViewForField={DocumentView} fieldKey={DataKey} />`; } + public static LayoutString(fieldType: { name: string }, fieldStr: string = "DataKey") { return `<${fieldType.name} doc={Document} DocumentViewForField={DocumentView} bindings={bindings} fieldKey={${fieldStr}} isSelected={isSelected} select={select} isTopMost={isTopMost} />`; } + @computed get field(): FieldValue<Field> { const { doc, fieldKey } = this.props; @@ -52,6 +61,8 @@ export class FieldView extends React.Component<FieldViewProps> { } else if (field instanceof NumberField) { return <p>{field.Data}</p> + } else if (field instanceof HtmlField) { + return <WebView {...this.props} /> } else if (field != FieldWaiting) { return <p>{field.GetValue}</p> } else |