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

Update use of $timeout function to be compatible with angular 1.3 #69

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-signature",
"version": "1.0.3",
"version": "1.0.5",
"description": "HTML5 canvas based smooth signature drawing as angularJS directive",
"main": "src/signature.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ angular.module('signature').directive('signaturePad', ['$interval', '$timeout',
scope: {
accept: '=?',
clear: '=?',
updateModel: '=?',
disabled: '=?',
dataurl: '=?',
height: '@',
Expand Down Expand Up @@ -47,7 +48,7 @@ angular.module('signature').directive('signaturePad', ['$interval', '$timeout',
defer handling mouseup event until $scope.signaturePad handles
first the same event
*/
$timeout().then(function () {
return $timeout(function () {
$scope.dataurl = $scope.signaturePad.isEmpty() ? EMPTY_IMAGE : $scope.signaturePad.toDataURL();
});
};
Expand Down Expand Up @@ -89,7 +90,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);
});
Expand Down