diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-07-06 19:50:02 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-07-06 19:50:02 -0400 |
commit | db9323fd2d44e665378d93d31bf343f8cc2e283d (patch) | |
tree | 4f316b026264fe6f11b3fb2c8ef8464436717839 /src | |
parent | a0688bd6417ef886eccac9051014470ebebf8847 (diff) |
fixed reordering in stacking view with minimized docs
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/CollectionStackingView.tsx | 16 |
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; |