diff options
author | bob <bcz@cs.brown.edu> | 2019-02-05 11:33:30 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-02-05 11:33:30 -0500 |
commit | 46a3ba510a02464b27b806af8fd1131dbc3da242 (patch) | |
tree | f2f247d04107062243fd36a1f59867ab84280014 /src/views/nodes/FieldView.tsx | |
parent | 58c7742c18f82fe854784b083dfa723a8f256b72 (diff) |
more reorg
Diffstat (limited to 'src/views/nodes/FieldView.tsx')
-rw-r--r-- | src/views/nodes/FieldView.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/views/nodes/FieldView.tsx b/src/views/nodes/FieldView.tsx index 9f0404dbf..370f6d324 100644 --- a/src/views/nodes/FieldView.tsx +++ b/src/views/nodes/FieldView.tsx @@ -6,7 +6,7 @@ import { Field, Opt } from "../../fields/Field"; import { TextField } from "../../fields/TextField"; import { NumberField } from "../../fields/NumberField"; import { RichTextField } from "../../fields/RichTextField"; -import { FieldTextBox } from "./FieldTextBox"; +import { FormattedTextBox } from "./FormattedTextBox"; import { ImageField } from "../../fields/ImageField"; import { ImageBox } from "./ImageBox"; import { Key } from "../../fields/Key"; @@ -15,7 +15,7 @@ import { DocumentView } from "./DocumentView"; // // these properties get assigned through the render() method of the DocumentView when it creates this node. // However, that only happens because the properties are "defined" in the markup for the field view. -// See the LayoutString method on each field view : ImageBox, FieldTextBox, etc. +// See the LayoutString method on each field view : ImageBox, FormattedTextBox, etc. // export interface FieldViewProps { fieldKey: Key; @@ -25,6 +25,7 @@ export interface FieldViewProps { @observer export class FieldView extends React.Component<FieldViewProps> { + public static LayoutString(fieldType: string) { return `<${fieldType} doc={Document} documentViewContainer={DocumentContentsView} fieldKey={DataKey} />`; } @computed get field(): Opt<Field> { const { doc, fieldKey } = this.props; @@ -39,7 +40,7 @@ export class FieldView extends React.Component<FieldViewProps> { return <p>{field.Data}</p> } else if (field instanceof RichTextField) { - return <FieldTextBox {...this.props} /> + return <FormattedTextBox {...this.props} /> } else if (field instanceof ImageField) { return <ImageBox {...this.props} /> |