diff options
Diffstat (limited to 'scripts/cards/drag.js')
-rw-r--r-- | scripts/cards/drag.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/cards/drag.js b/scripts/cards/drag.js index 1014656..b24ccb1 100644 --- a/scripts/cards/drag.js +++ b/scripts/cards/drag.js @@ -12,6 +12,9 @@ class MultiDrag extends EventTarget { window.addEventListener("mouseup", this.stopDraggingAll.bind(this)); document.body.addEventListener("mouseleave", this.stopDraggingAll.bind(this)); + //window.addEventListener("touchend", this.stopDraggingAll.bind(this)); + //window.addEventListener("touchcancel", this.stopDraggingAll.bind(this)); + this.ret = ret; } @@ -143,10 +146,14 @@ class MultiDrag extends EventTarget { } addTarget(e) { - e.addEventListener("mousedown", this.startDragging.bind(this)); + e.d1 = this.startDragging.bind(this); + //e.d2 = this.startTouchDrag.bind(this); + e.addEventListener("mousedown", e.d1); + //e.addEventListener("touchstart", e.d2); } removeTarget (e) { - e.removeEventListener("mousedown", this.startDragging.bind(this)); + e.removeEventListener("mousedown", e.d1); + e.removeEventListener("touchstart", e.d2); } }
\ No newline at end of file |