aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSubView.tsx
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-04 18:07:07 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-04 18:07:07 +0800
commitab7eae26debd40a3d93d3b129947da32d099acb1 (patch)
treee101765f8c51f2796102e0ef23cb66211a6e45c2 /src/client/views/collections/CollectionSubView.tsx
parent6ea1420c502f76a1c3219e0c34633575fb00ec98 (diff)
parent78c99446f284f7ac8e5443f77227ae5edbfd2aaf (diff)
Merge branch 'master' into presentation_updates
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
-rw-r--r--src/client/views/collections/CollectionSubView.tsx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index c90e85271..3ebc6baca 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -185,13 +185,10 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?:
@action
protected onInternalDrop(e: Event, de: DragManager.DropEvent): boolean {
const docDragData = de.complete.docDragData;
- ScriptCast(this.props.Document.dropConverter)?.script.run({ dragData: docDragData });
if (docDragData) {
let added = false;
- const dropaction = docDragData.dropAction || docDragData.userDropAction;
- if (dropaction && dropaction !== "move") {
- added = this.addDocument(docDragData.droppedDocuments);
- } else if (docDragData.moveDocument) {
+ const dropAction = docDragData.dropAction || docDragData.userDropAction;
+ if ((!dropAction || dropAction === "move") && 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.addDocument(addedDocs) : true;
@@ -201,6 +198,7 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?:
added = docDragData.moveDocument(movedDocs, this.props.Document, canAdd ? this.addDocument : returnFalse);
} else added = res;
} else {
+ ScriptCast(this.props.Document.dropConverter)?.script.run({ dragData: docDragData });
added = this.addDocument(docDragData.droppedDocuments);
}
added && e.stopPropagation();