From 18b7e05eb27bbe9ad43644a68e0361884e32f37c Mon Sep 17 00:00:00 2001 From: Fabian Hickert Date: Thu, 24 Jan 2013 11:32:58 +0000 Subject: [PATCH] Fixed event handling for touch-supported devices. --- dist/all.min.js.gz | Bin 43217 -> 43217 bytes src/canvas_events.mixin.js | 14 +++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/all.min.js.gz b/dist/all.min.js.gz index 1abbe1f292bcc17429d04ef0832c5672de7b04cc..c7976b5d6df5789e8a5c435fdb02b9274c38a645 100644 GIT binary patch delta 19 bcmcb3k?G<^CJy;-4vsP@#=wmnCszOfOIZgO delta 19 bcmcb3k?G<^CJy;-4vwqge*!jgoLm6_RoMuw diff --git a/src/canvas_events.mixin.js b/src/canvas_events.mixin.js index de0c6939..349b8244 100644 --- a/src/canvas_events.mixin.js +++ b/src/canvas_events.mixin.js @@ -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; } }); -})(); \ No newline at end of file +})();