aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ButtonBox.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-12-12 15:29:46 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-12-12 15:29:46 -0500
commit1ff9b625f6292286162ee66b7b14ef8f04b20a19 (patch)
treef58b2d5aa71b7ba4a6444e9f0d2b9dcf065ff9ab /src/client/views/nodes/ButtonBox.tsx
parentf0fabedecfeba03f19c221d1f7839a7a7e0050df (diff)
parentc21958664a8050fbe9d420c41330c1adcc402ae6 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/nodes/ButtonBox.tsx')
-rw-r--r--src/client/views/nodes/ButtonBox.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/nodes/ButtonBox.tsx b/src/client/views/nodes/ButtonBox.tsx
index 34151a311..d1272c266 100644
--- a/src/client/views/nodes/ButtonBox.tsx
+++ b/src/client/views/nodes/ButtonBox.tsx
@@ -46,7 +46,7 @@ export class ButtonBox extends DocComponent<FieldViewProps, ButtonDocument>(Butt
this.dropDisposer();
}
if (ele) {
- this.dropDisposer = DragManager.MakeDropTarget(ele, { handlers: { drop: this.drop.bind(this) } });
+ this.dropDisposer = DragManager.MakeDropTarget(ele, this.drop.bind(this));
}
}
@@ -65,9 +65,10 @@ export class ButtonBox extends DocComponent<FieldViewProps, ButtonDocument>(Butt
@undoBatch
@action
drop = (e: Event, de: DragManager.DropEvent) => {
- if (de.data instanceof DragManager.DocumentDragData && e.target) {
- this.props.Document[(e.target as any).textContent] = new List<Doc>(de.data.droppedDocuments.map((d, i) =>
- d.onDragStart ? de.data.draggedDocuments[i] : d));
+ const docDragData = de.complete.docDragData;
+ if (docDragData && e.target) {
+ this.props.Document[(e.target as any).textContent] = new List<Doc>(docDragData.droppedDocuments.map((d, i) =>
+ d.onDragStart ? docDragData.draggedDocuments[i] : d));
e.stopPropagation();
}
}