diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-02 23:13:07 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-02 23:13:07 -0400 |
commit | 14232f5951af02d5a10ce0435a8b38a4e0502cbb (patch) | |
tree | 96b3d175c57e3e88923d79c0cb3aab1e9bd809a7 /src | |
parent | 021e8cbe9892d0a9e277026b933ac634a7a9eba5 (diff) |
Made DocumentContents JsxParser an observer
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/DocumentContentsView.tsx | 11 | ||||
-rw-r--r-- | src/new_fields/Doc.ts | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx index ddfe79a5c..bbc927b5a 100644 --- a/src/client/views/nodes/DocumentContentsView.tsx +++ b/src/client/views/nodes/DocumentContentsView.tsx @@ -30,6 +30,15 @@ export interface JsxBindings { props: BindingProps; } +class ObserverJsxParser1 extends JsxParser { + constructor(props: any) { + super(props); + observer(this as any); + } +} + +const ObserverJsxParser: typeof JsxParser = ObserverJsxParser1 as any; + @observer export class DocumentContentsView extends React.Component<DocumentViewProps & { isSelected: () => boolean, @@ -63,7 +72,7 @@ export class DocumentContentsView extends React.Component<DocumentViewProps & { } render() { - return <JsxParser + return <ObserverJsxParser components={{ FormattedTextBox, ImageBox, IconBox, FieldView, CollectionFreeFormView, CollectionDockingView, CollectionSchemaView, CollectionView, CollectionPDFView, CollectionVideoView, WebBox, KeyValueBox, PDFBox, VideoBox, AudioBox, HistogramBox }} bindings={this.CreateBindings()} jsx={this.finalLayout} diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 978aacaac..3eea6d2b2 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -10,7 +10,6 @@ import { List } from "./List"; import { ObjectField, Parent, OnUpdate } from "./ObjectField"; import { RefField, FieldId, Id, HandleUpdate } from "./RefField"; import { Docs } from "../client/documents/Documents"; -// import { Docs } from "../client/documents/Documents"; export function IsField(field: any): field is Field { return (typeof field === "string") |