aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSubView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-05-07 19:18:52 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-05-07 19:18:52 -0400
commitfcd0895e5933270718b9c1a262e7e377eaabb024 (patch)
treeff2c228814674e5aa7f88be8501863b6eb85b232 /src/client/views/collections/CollectionSubView.tsx
parent34db0a78d2dc8989313decf8993691f40847b231 (diff)
fixed most add/remove/move documents to support doc[]'s
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
-rw-r--r--src/client/views/collections/CollectionSubView.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 250c9b3b0..ae84b1923 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -27,9 +27,9 @@ import { CollectionView } from "./CollectionView";
import React = require("react");
export interface CollectionViewProps extends FieldViewProps {
- addDocument: (document: Doc) => boolean;
- removeDocument: (document: Doc) => boolean;
- moveDocument: (document: Doc, targetCollection: Doc | undefined, addDocument: (document: Doc) => boolean) => boolean;
+ addDocument: (document: Doc | Doc[]) => boolean;
+ removeDocument: (document: Doc | Doc[]) => boolean;
+ moveDocument: (document: Doc | Doc[], targetCollection: Doc | undefined, addDocument: (document: Doc | Doc[]) => boolean) => boolean;
PanelWidth: () => number;
PanelHeight: () => number;
VisibleHeight?: () => number;
@@ -212,14 +212,14 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?:
if (docDragData) {
let added = false;
if (docDragData.dropAction || docDragData.userDropAction) {
- added = this.props.addDocument(docDragData.droppedDocuments as any as Doc);
+ added = this.props.addDocument(docDragData.droppedDocuments);
} else if (docDragData.moveDocument) {
const movedDocs = docDragData.droppedDocuments.filter((d, i) => docDragData.draggedDocuments[i] === d);
const addedDocs = docDragData.droppedDocuments.filter((d, i) => docDragData.draggedDocuments[i] !== d);
- const res = addedDocs.length ? this.props.addDocument(addedDocs as any as Doc) : true;
- added = movedDocs.length ? docDragData.moveDocument(movedDocs as any as Doc, this.props.Document, this.props.addDocument) : res;
+ const res = addedDocs.length ? this.props.addDocument(addedDocs) : true;
+ added = movedDocs.length ? docDragData.moveDocument(movedDocs, this.props.Document, this.props.addDocument) : res;
} else {
- added = this.props.addDocument(docDragData.droppedDocuments as any as Doc);
+ added = this.props.addDocument(docDragData.droppedDocuments);
}
e.stopPropagation();
return added;