diff options
| author | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-10-22 19:23:07 +0800 |
|---|---|---|
| committer | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-10-22 19:23:07 +0800 |
| commit | 9e292278980606062db08df91706ca4d5b78abde (patch) | |
| tree | fec75dbdf36098b537522b2f4ed67607cd920309 /src/client/views/collections/CollectionStackingView.tsx | |
| parent | 35e33edd138009af5a9f3e22493e67bccccb251e (diff) | |
| parent | 93ff528ebce3ac970fa7a5d299fd3bfbc2ee021e (diff) | |
Merge branch 'master' into presentation_v1
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionStackingView.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index 1ed7652e0..882a7fdec 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -296,7 +296,7 @@ export class CollectionStackingView extends CollectionSubView<StackingDocument, if (docs && newDocs.length) { console.log(newDocs) const insertInd = dropInd === -1 ? docs.length : dropInd + dropAfter; - const offset = newDocs.reduce((off, ndoc) => this.filteredChildren.find((fdoc, i) => ndoc === fdoc && i <= insertInd) ? off + 1 : off, 0); + const offset = newDocs.reduce((off, ndoc) => this.filteredChildren.find((fdoc, i) => ndoc === fdoc && i < insertInd) ? off + 1 : off, 0); newDocs.filter(ndoc => docs.indexOf(ndoc) !== -1).forEach(ndoc => docs.splice(docs.indexOf(ndoc), 1)); docs.splice(insertInd - offset, 0, ...newDocs); } |
