aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorljungster <parkerljung@gmail.com>2022-06-22 14:37:44 -0500
committerljungster <parkerljung@gmail.com>2022-06-22 14:37:44 -0500
commitbb02d3a052efdbf25d1069059a92b7a9d9cc1708 (patch)
treefbdb38cc8af87186d58edce6f6361f56421ef7b6 /src
parentb9686678573ee601da90b07d62da175a2f64c40c (diff)
did it!
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/CollectionNoteTakingView.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx
index dfee1b173..9519e9aaa 100644
--- a/src/client/views/collections/CollectionNoteTakingView.tsx
+++ b/src/client/views/collections/CollectionNoteTakingView.tsx
@@ -418,19 +418,21 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
const droppedDocs = this.childDocs.slice().filter((d: Doc, ind: number) => ind >= this.childDocs.length); // if the drop operation adds something to the end of the list, then use that as the new document (may be different than what was dropped e.g., in the case of a button which is dropped but which creates say, a note).
const newDocs = droppedDocs.length ? droppedDocs : de.complete.docDragData.droppedDocuments;
- const docs = this.childDocs
+ // const docs = this.childDocs
+ const docs = this.childDocList
if (docs && newDocs.length) {
// remove the dragged documents from the childDocList
newDocs.filter(d => docs.indexOf(d) !== -1).forEach(d => docs.splice(docs.indexOf(d), 1))
// if the doc starts a columnm (or the drop index is undefined), we can just push it to the front. Otherwise we need to add it to the column properly
//TODO: you need to update childDocList instead. It seems that childDocs is a copy of the actual array we want to modify
if (rowCol[0] <= 0) {
- docs.unshift(...newDocs)
+ docs.splice(0, 0, ...newDocs)
} else {
const colDocs = this.getDocsFromXCoord(de.x)
const previousDoc = colDocs[rowCol[0] - 1]
const previousDocIndex = docs.indexOf(previousDoc)
- docs.splice(previousDocIndex, 0, ...newDocs)
+ console.log(`docs: ${previousDocIndex}`)
+ docs.splice(previousDocIndex + 1, 0, ...newDocs)
}
}
}