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

Update to allow signature to be disabled/enabled #51

Merged
merged 1 commit into from
Apr 23, 2017
Merged
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
5 changes: 5 additions & 0 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: '=?',
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