aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-07-06 19:50:02 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-07-06 19:50:02 -0400
commitdb9323fd2d44e665378d93d31bf343f8cc2e283d (patch)
tree4f316b026264fe6f11b3fb2c8ef8464436717839
parenta0688bd6417ef886eccac9051014470ebebf8847 (diff)
fixed reordering in stacking view with minimized docs
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 5f81579a8..aea74321e 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -187,14 +187,14 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
})
}
if (super.drop(e, de)) {
- if (targInd !== -1) {
- let newDoc = de.data.droppedDocuments[0];
- let docs = this.childDocList;
- if (docs) {
- let srcInd = docs.indexOf(newDoc);
- docs.splice(srcInd, 1);
- docs.splice(targInd > srcInd ? targInd - 1 : targInd, 0, newDoc);
- }
+ let newDoc = de.data.droppedDocuments[0];
+ let docs = this.childDocList;
+ if (docs) {
+ if (targInd === -1) targInd = docs.length;
+ else targInd = docs.indexOf(this.filteredChildren[targInd]);
+ let srcInd = docs.indexOf(newDoc);
+ docs.splice(srcInd, 1);
+ docs.splice(targInd > srcInd ? targInd - 1 : targInd, 0, newDoc);
}
}
return false;