diff options
| author | bob <bcz@cs.brown.edu> | 2019-02-06 16:11:42 -0500 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-02-06 16:11:42 -0500 |
| commit | 59d5992f2a101eff7743328c3fdefe6a0006ada9 (patch) | |
| tree | b28dbb2e06f1fffeafcd2b43845072f9f3f6f1fc /src/views/collections/CollectionDockingView.tsx | |
| parent | 7598b88bbad9690c59f8b164144aa0d02a0a211f (diff) | |
| parent | 84eea14a86265ce0585342d9f3a3c4107c02df17 (diff) | |
woring db stub.
Diffstat (limited to 'src/views/collections/CollectionDockingView.tsx')
| -rw-r--r-- | src/views/collections/CollectionDockingView.tsx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/views/collections/CollectionDockingView.tsx b/src/views/collections/CollectionDockingView.tsx index 4bbbeeecd..e489e319a 100644 --- a/src/views/collections/CollectionDockingView.tsx +++ b/src/views/collections/CollectionDockingView.tsx @@ -15,7 +15,7 @@ import * as GoldenLayout from "golden-layout"; import * as ReactDOM from 'react-dom'; import { DragManager } from "../../util/DragManager"; import { CollectionViewBase, CollectionViewProps, COLLECTION_BORDER_WIDTH } from "./CollectionViewBase"; -import { WAITING } from "../../fields/Field"; +import { FieldWaiting } from "../../fields/Field"; @observer export class CollectionDockingView extends CollectionViewBase { @@ -26,7 +26,7 @@ export class CollectionDockingView extends CollectionViewBase { @computed private get modelForFlexLayout() { const { CollectionFieldKey: fieldKey, DocumentForCollection: Document } = this.props; - const value: Document[] = Document.GetFieldValue(fieldKey, ListField, []); + const value: Document[] = Document.GetData(fieldKey, ListField, []); var docs = value.map(doc => { return { type: 'tabset', weight: 50, selected: 0, children: [{ type: "tab", name: doc.Title, component: doc.Id }] }; }); @@ -42,7 +42,7 @@ export class CollectionDockingView extends CollectionViewBase { @computed private get modelForGoldenLayout(): any { const { CollectionFieldKey: fieldKey, DocumentForCollection: Document } = this.props; - const value: Document[] = Document.GetFieldValue(fieldKey, ListField, []); + const value: Document[] = Document.GetData(fieldKey, ListField, []); var docs = value.map(doc => { return { type: 'component', componentName: 'documentViewComponent', componentState: { doc: doc } }; }); @@ -70,7 +70,7 @@ export class CollectionDockingView extends CollectionViewBase { @action onResize = (event: any) => { - if (this.props.ContainingDocumentView == WAITING) + if (this.props.ContainingDocumentView == FieldWaiting) return; var cur = this.props.ContainingDocumentView!.MainContent.current; @@ -96,10 +96,9 @@ export class CollectionDockingView extends CollectionViewBase { return <button>{node.getName()}</button>; } const { CollectionFieldKey: fieldKey, DocumentForCollection: Document } = this.props; - const value: Document[] = Document.GetFieldValue(fieldKey, ListField, []); + const value: Document[] = Document.GetData(fieldKey, ListField, []); for (var i: number = 0; i < value.length; i++) { if (value[i].Id === component) { - var data = value[i].GetField(KeyStore.Data); return (<DocumentView key={value[i].Id} ContainingCollectionView={this} Document={value[i]} DocumentView={undefined} />); } } @@ -240,7 +239,6 @@ export class CollectionDockingView extends CollectionViewBase { var containingDiv = "component_" + me.nextId(); container.getElement().html("<div id='" + containingDiv + "'></div>"); setTimeout(function () { - var data = state.doc.GetField(KeyStore.Data); ReactDOM.render(( <DocumentView key={state.doc.Id} Document={state.doc} ContainingCollectionView={me} DocumentView={undefined} /> ), @@ -257,14 +255,14 @@ export class CollectionDockingView extends CollectionViewBase { render() { - if (this.props.ContainingDocumentView == WAITING) + if (this.props.ContainingDocumentView == FieldWaiting) return; const { CollectionFieldKey: fieldKey, DocumentForCollection: Document } = this.props; - const value: Document[] = Document.GetFieldValue(fieldKey, ListField, []); + const value: Document[] = Document.GetData(fieldKey, ListField, []); // bcz: not sure why, but I need these to force the flexlayout to update when the collection size changes. var s = this.props.ContainingDocumentView != undefined ? this.props.ContainingDocumentView!.ScalingToScreenSpace : 1; - var w = Document.GetFieldValue(KeyStore.Width, NumberField, Number(0)) / s; - var h = Document.GetFieldValue(KeyStore.Height, NumberField, Number(0)) / s; + var w = Document.GetData(KeyStore.Width, NumberField, Number(0)) / s; + var h = Document.GetData(KeyStore.Height, NumberField, Number(0)) / s; var chooseLayout = () => { if (!CollectionDockingView.UseGoldenLayout) |
