Skip to content
This repository has been archived by the owner on Nov 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #52 from tommaitland/patch-1
Browse files Browse the repository at this point in the history
Block default touch functionality on the canvas
  • Loading branch information
jasny committed Apr 24, 2017
2 parents a8467d0 + dde09b5 commit 910fb77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/signature.js
Expand Up @@ -135,21 +135,23 @@ angular.module('signature').directive('signaturePad', ['$interval', '$timeout',
element.on('touchstart', onTouchstart);
element.on('touchend', onTouchend);

function onTouchstart() {
function onTouchstart(event) {
scope.$apply(function () {
// notify that drawing has started
scope.notifyDrawing({ drawing: true });
});
event.preventDefault();
}

function onTouchend() {
function onTouchend(event) {
scope.$apply(function () {
// updateModel
scope.updateModel();

// notify that drawing has ended
scope.notifyDrawing({ drawing: false });
});
event.preventDefault();
}
}
};
Expand Down

0 comments on commit 910fb77

Please sign in to comment.