mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-01 18:44:42 +00:00
Merge pull request #397 from hickert/master
Update event registration for touch devices
This commit is contained in:
commit
90b383246f
2 changed files with 7 additions and 7 deletions
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
|
|
@ -55,13 +55,13 @@
|
|||
_onMouseDown: function (e) {
|
||||
this.__onMouseDown(e);
|
||||
|
||||
addListener(fabric.document, 'mouseup', this._onMouseUp);
|
||||
!fabric.isTouchSupported && addListener(fabric.document, 'mouseup', this._onMouseUp);
|
||||
fabric.isTouchSupported && addListener(fabric.document, 'touchend', this._onMouseUp);
|
||||
|
||||
addListener(fabric.document, 'mousemove', this._onMouseMove);
|
||||
!fabric.isTouchSupported && addListener(fabric.document, 'mousemove', this._onMouseMove);
|
||||
fabric.isTouchSupported && addListener(fabric.document, 'touchmove', this._onMouseMove);
|
||||
|
||||
removeListener(this.upperCanvasEl, 'mousemove', this._onMouseMove);
|
||||
!fabric.isTouchSupported && removeListener(this.upperCanvasEl, 'mousemove', this._onMouseMove);
|
||||
fabric.isTouchSupported && removeListener(this.upperCanvasEl, 'touchmove', this._onMouseMove);
|
||||
},
|
||||
|
||||
|
|
@ -72,13 +72,13 @@
|
|||
_onMouseUp: function (e) {
|
||||
this.__onMouseUp(e);
|
||||
|
||||
removeListener(fabric.document, 'mouseup', this._onMouseUp);
|
||||
!fabric.isTouchSupported && removeListener(fabric.document, 'mouseup', this._onMouseUp);
|
||||
fabric.isTouchSupported && removeListener(fabric.document, 'touchend', this._onMouseUp);
|
||||
|
||||
removeListener(fabric.document, 'mousemove', this._onMouseMove);
|
||||
!fabric.isTouchSupported && removeListener(fabric.document, 'mousemove', this._onMouseMove);
|
||||
fabric.isTouchSupported && removeListener(fabric.document, 'touchmove', this._onMouseMove);
|
||||
|
||||
addListener(this.upperCanvasEl, 'mousemove', this._onMouseMove);
|
||||
!fabric.isTouchSupported && addListener(this.upperCanvasEl, 'mousemove', this._onMouseMove);
|
||||
fabric.isTouchSupported && addListener(this.upperCanvasEl, 'touchmove', this._onMouseMove);
|
||||
},
|
||||
|
||||
|
|
@ -478,4 +478,4 @@
|
|||
return true;
|
||||
}
|
||||
});
|
||||
})();
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue