Mercurial Hosting > dad
comparison src/dad.js @ 5:1293cb0d30da
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 23 Apr 2023 17:14:52 -0600 |
parents | 0130ae25ef94 |
children | 4d699321068f |
comparison
equal
deleted
inserted
replaced
4:0130ae25ef94 | 5:1293cb0d30da |
---|---|
44 } | 44 } |
45 | 45 |
46 function onMouseUp(event) { | 46 function onMouseUp(event) { |
47 //console.log(event); | 47 //console.log(event); |
48 dad.onDrop({ | 48 dad.onDrop({ |
49 draggable: original, | 49 original: original, |
50 dragged: dragging, | 50 dragging: dragging, |
51 mouseEvent: event, | 51 mouseEvent: event, |
52 }); | 52 }); |
53 original.removeAttribute('dad-original'); | 53 original.removeAttribute('dad-original'); |
54 dragging.parentNode.removeChild(dragging); | 54 dragging.parentNode.removeChild(dragging); |
55 document.removeEventListener('mousemove',onMouseMove); | 55 document.removeEventListener('mousemove',onMouseMove); |
56 document.removeEventListener('mouseup',onMouseUp); | 56 document.removeEventListener('mouseup',onMouseUp); |
57 document.removeEventListener('mousemove',onMouseMove); | 57 document.removeEventListener('mousemove',onMouseMove); |
58 document.removeEventListener('touchend',onMouseUp); | 58 document.removeEventListener('touchend',onMouseUp); |
59 original.scrollIntoViewIfNeeded(false); | 59 original.scrollIntoViewIfNeeded(false); |
60 let droppedEvent = { | 60 let droppedEvent = { |
61 draggable: original, | 61 original: original, |
62 }; | 62 }; |
63 original = null; | 63 original = null; |
64 dragging = null; | 64 dragging = null; |
65 dad.onDropped(droppedEvent); | 65 dad.onDropped(droppedEvent); |
66 } | 66 } |