From 7021319fa13eb5395d352f5dc21864272fda4f91 Mon Sep 17 00:00:00 2001 From: mtomic Date: Fri, 19 Feb 2016 08:56:15 +1100 Subject: [PATCH] Fix touched event on touch devices --- src/signature_pad.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/signature_pad.js b/src/signature_pad.js index 8cbc2087..d02ba490 100644 --- a/src/signature_pad.js +++ b/src/signature_pad.js @@ -149,7 +149,7 @@ var SignaturePad = (function (document) { this._canvas.addEventListener("touchstart", this._handleTouchStart); this._canvas.addEventListener("touchmove", this._handleTouchMove); - document.addEventListener("touchend", this._handleTouchEnd); + this._canvas.addEventListener("touchend", this._handleTouchEnd); }; SignaturePad.prototype.on = function () { @@ -164,7 +164,7 @@ var SignaturePad = (function (document) { this._canvas.removeEventListener("touchstart", this._handleTouchStart); this._canvas.removeEventListener("touchmove", this._handleTouchMove); - document.removeEventListener("touchend", this._handleTouchEnd); + this._canvas.removeEventListener("touchend", this._handleTouchEnd); }; SignaturePad.prototype.isEmpty = function () {