From 542fba821f94d11cc9d89bbc921c426ab3bda438 Mon Sep 17 00:00:00 2001 From: Saurabh Goyal Date: Wed, 27 Sep 2017 19:00:03 +0530 Subject: [PATCH 1/3] fix usage of timeout function as per angular dependency --- src/signature.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/signature.js b/src/signature.js index d484776..374ca74 100644 --- a/src/signature.js +++ b/src/signature.js @@ -47,7 +47,7 @@ angular.module('signature').directive('signaturePad', ['$interval', '$timeout', defer handling mouseup event until $scope.signaturePad handles first the same event */ - $timeout().then(function () { + $timeout(function () { $scope.dataurl = $scope.signaturePad.isEmpty() ? EMPTY_IMAGE : $scope.signaturePad.toDataURL(); }); }; @@ -89,7 +89,7 @@ angular.module('signature').directive('signaturePad', ['$interval', '$timeout', scope.signaturePad.clear(); scope.signaturePad.fromDataURL(dataUrl); - $timeout().then(function() { + $timeout(function () { ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.scale(1 / scale, 1 / scale); }); From bf386c2f5b8f11849092098bf94c42d29bca6835 Mon Sep 17 00:00:00 2001 From: Saurabh Goyal Date: Wed, 27 Sep 2017 19:26:55 +0530 Subject: [PATCH 2/3] increase patch version for the fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd93240..9f4ff18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-signature", - "version": "1.0.3", + "version": "1.0.4", "description": "HTML5 canvas based smooth signature drawing as angularJS directive", "main": "src/signature.js", "scripts": { From b513709b44e411d6853d7031a01b8a933b71acf1 Mon Sep 17 00:00:00 2001 From: Saurabh Goyal Date: Wed, 4 Oct 2017 12:55:07 +0530 Subject: [PATCH 3/3] expose update-model method for use --- package.json | 2 +- src/signature.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9f4ff18..9ea240d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-signature", - "version": "1.0.4", + "version": "1.0.5", "description": "HTML5 canvas based smooth signature drawing as angularJS directive", "main": "src/signature.js", "scripts": { diff --git a/src/signature.js b/src/signature.js index 374ca74..c84b54d 100644 --- a/src/signature.js +++ b/src/signature.js @@ -18,6 +18,7 @@ angular.module('signature').directive('signaturePad', ['$interval', '$timeout', scope: { accept: '=?', clear: '=?', + updateModel: '=?', disabled: '=?', dataurl: '=?', height: '@', @@ -47,7 +48,7 @@ angular.module('signature').directive('signaturePad', ['$interval', '$timeout', defer handling mouseup event until $scope.signaturePad handles first the same event */ - $timeout(function () { + return $timeout(function () { $scope.dataurl = $scope.signaturePad.isEmpty() ? EMPTY_IMAGE : $scope.signaturePad.toDataURL(); }); };