aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2022-08-24 18:36:14 -0400
committermehekj <mehek.jethani@gmail.com>2022-08-24 18:36:14 -0400
commite60323cb8c59823571c0c91069518145cb3fb6a1 (patch)
tree869eab9d1cd340293c52061b5f7f456f50a175db /src
parent94dbcc40067cb6637f7a535ff305d9452a3f40d1 (diff)
fixed stacking view external drop to work
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index d4efef47a..6c6cb64da 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -493,13 +493,14 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
targInd = i;
}
});
- super.onExternalDrop(e, {}, () => {
- if (targInd !== -1) {
- const newDoc = this.childDocs[this.childDocs.length - 1];
- const docs = this.childDocList;
- if (docs) {
- docs.splice(docs.length - 1, 1);
- docs.splice(targInd, 0, newDoc);
+ super.onExternalDrop(e, {}, (docs: Doc[]) => {
+ if (targInd === -1) {
+ this.addDocument(docs);
+ }
+ else {
+ const childDocs = this.childDocList;
+ if (childDocs) {
+ childDocs.splice(targInd, 0, ...docs);
}
}
});