|
@@ -4,10 +4,12 @@ function startDrag(event) {
|
|
|
const dy = event.clientY - el.offsetTop;
|
|
|
|
|
|
function doDrag(e) {
|
|
|
+ el.style.pointerEvents = 'none';
|
|
|
el.style.left = e.clientX - dx + 'px';
|
|
|
el.style.top = e.clientY - dy + 'px';
|
|
|
}
|
|
|
function stopDrag() {
|
|
|
+ el.style.pointerEvents = null;
|
|
|
document.removeEventListener('mousemove', doDrag);
|
|
|
document.removeEventListener('mouseup', stopDrag);
|
|
|
}
|
|
@@ -15,6 +17,7 @@ function startDrag(event) {
|
|
|
document.addEventListener('mouseup', stopDrag);
|
|
|
}
|
|
|
const drag = (el, binding) => {
|
|
|
+ el.style.pointerEvents = null;
|
|
|
el.addEventListener('mousedown', startDrag);
|
|
|
};
|
|
|
|