Mercurial Hosting > dad
diff src/examples/drop.html @ 5:1293cb0d30da
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 23 Apr 2023 17:14:52 -0600 |
parents | 0130ae25ef94 |
children | 332d3e280f7e |
line wrap: on
line diff
--- a/src/examples/drop.html Sat Apr 22 21:17:53 2023 -0600 +++ b/src/examples/drop.html Sun Apr 23 17:14:52 2023 -0600 @@ -25,12 +25,12 @@ }; dad.onDrop = function(event) { - let draggable = event.draggable; - let style = draggable.style; + let original = event.original; + let style = original.style; let left = style.left ? parseInt(style.left) : 0; let top = style.top ? parseInt(style.top) : 0; - let rectDragged = event.dragged.getBoundingClientRect(); - let rectDraggable = draggable.getBoundingClientRect(); + let rectDragged = event.dragging.getBoundingClientRect(); + let rectDraggable = original.getBoundingClientRect(); left += rectDragged.x - rectDraggable.x; top += rectDragged.y - rectDraggable.y; style.left = left + 'px';