aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-03-23 00:22:52 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-03-23 00:22:52 -0400
commit356991c6100a44ef45b4574b43c815383d9be751 (patch)
tree07156507ab60703e9a0b9e4893a0b2e829dde9c5 /src/client/views/collections/CollectionFreeFormView.tsx
parent6d68c6e5e5f8f8ea8b1bbad10148a691a8c2e23f (diff)
Various fixes for the demo
Diffstat (limited to 'src/client/views/collections/CollectionFreeFormView.tsx')
-rw-r--r--src/client/views/collections/CollectionFreeFormView.tsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx
index da9f7b392..8f7b4cfe7 100644
--- a/src/client/views/collections/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/CollectionFreeFormView.tsx
@@ -83,6 +83,10 @@ export class CollectionFreeFormView extends CollectionViewBase {
const [x, y] = this.getTransform().transformPoint(screenX, screenY);
de.data.droppedDocument.SetNumber(KeyStore.X, x);
de.data.droppedDocument.SetNumber(KeyStore.Y, y);
+ if (!de.data.droppedDocument.GetNumber(KeyStore.Width, 0)) {
+ de.data.droppedDocument.SetNumber(KeyStore.Width, 300);
+ de.data.droppedDocument.SetNumber(KeyStore.Height, 300);
+ }
this.bringToFront(de.data.droppedDocument);
}
}
@@ -259,6 +263,7 @@ export class CollectionFreeFormView extends CollectionViewBase {
const lvalue = this.props.Document.GetT<ListField<Document>>(this.props.fieldKey, ListField);
if (lvalue && lvalue != FieldWaiting) {
return lvalue.Data.map(doc => {
+ if (!doc) return null;
var page = doc.GetNumber(KeyStore.Page, 0);
return (page != curPage && page != 0) ? (null) :
(<CollectionFreeFormDocumentView key={doc.Id} {...this.getDocumentViewProps(doc)} />);