aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FieldView.tsx
diff options
context:
space:
mode:
authorMonika Hedman <monika_hedman@brown.edu>2019-02-24 16:26:14 -0500
committerMonika Hedman <monika_hedman@brown.edu>2019-02-24 16:26:14 -0500
commitb119b7d4b38c3eada66e4ac49f1d65dfae6b22c0 (patch)
treeae38ab0d33da6354d0777c4f159363d3f3783e45 /src/client/views/nodes/FieldView.tsx
parent1447bcdb79425d2e520ca39732d600466deb242c (diff)
parentd9d55e422826da1fe87aa7973c92e54bc0c99f02 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into navigation
Diffstat (limited to 'src/client/views/nodes/FieldView.tsx')
-rw-r--r--src/client/views/nodes/FieldView.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx
index 08de53e1c..1a9d325db 100644
--- a/src/client/views/nodes/FieldView.tsx
+++ b/src/client/views/nodes/FieldView.tsx
@@ -10,6 +10,8 @@ import { ImageField } from "../../../fields/ImageField";
import { Key } from "../../../fields/Key";
import { FormattedTextBox } from "./FormattedTextBox";
import { ImageBox } from "./ImageBox";
+import { HtmlField } from "../../../fields/HtmlField";
+import { WebView } from "./WebView";
//
// these properties get assigned through the render() method of the DocumentView when it creates this node.
@@ -20,12 +22,15 @@ export interface FieldViewProps {
fieldKey: Key;
doc: Document;
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} isSelected={isSelected} isTopMost={isTopMost} />`; }
+ 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;
@@ -47,6 +52,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