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 #51 from JonSnaka/patch-1
Browse files Browse the repository at this point in the history
Update to allow signature to be disabled/enabled
  • Loading branch information
jasny committed Apr 23, 2017
2 parents f4e4e18 + 5f6c8f6 commit 2911abb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/signature.js
Expand Up @@ -18,6 +18,7 @@ angular.module('signature').directive('signaturePad', ['$interval', '$timeout',
scope: {
accept: '=?',
clear: '=?',
disabled: '=?',
dataurl: '=?',
height: '@',
width: '@',
Expand Down Expand Up @@ -94,6 +95,10 @@ angular.module('signature').directive('signaturePad', ['$interval', '$timeout',
});
};

scope.$watch('disabled', function (val) {
val ? scope.signaturePad.off() : scope.signaturePad.on();
});

var calculateScale = function() {
var scaleWidth = Math.min(parent.clientWidth / width, 1);
var scaleHeight = Math.min(parent.clientHeight / height, 1);
Expand Down

0 comments on commit 2911abb

Please sign in to comment.