aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionView.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-02-25 16:08:36 -0500
committerbob <bcz@cs.brown.edu>2019-02-25 16:08:36 -0500
commit39215d8999413a5e27d222c6650fc9e84c7a9ae9 (patch)
tree61739afc1e830e54706079590ccfcb6bf70db356 /src/client/views/collections/CollectionView.tsx
parentad1aab1e757a2f0d8acc6038c19c54caa5b1ec48 (diff)
added drag/drop out of schema view
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
-rw-r--r--src/client/views/collections/CollectionView.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index 6d30cf365..83886f933 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -53,7 +53,13 @@ export class CollectionView extends React.Component<CollectionViewProps> {
removeDocument = (doc: Document): boolean => {
//TODO This won't create the field if it doesn't already exist
const value = this.props.Document.GetData(this.props.fieldKey, ListField, new Array<Document>())
- let index = value.indexOf(doc);
+ let index = -1;
+ for (let i = 0; i < value.length; i++) {
+ if (value[i].Id == doc.Id) {
+ index = i;
+ break;
+ }
+ }
if (index !== -1) {
value.splice(index, 1)