Skip to content

Commit

Permalink
Added: An onDrawEnd callback; GitHub Pull Request #70.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjbradley committed Jul 16, 2013
1 parent d389322 commit f1d8798
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jquery.signaturepad.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,8 @@ function SignaturePad (selector, options) {
previous.x = newX
previous.y = newY

if (settings.onDraw && typeof settings.onDraw === 'function') {
if (settings.onDraw && typeof settings.onDraw === 'function')
settings.onDraw.apply(self)
}

}

/**
Expand All @@ -217,6 +215,9 @@ function SignaturePad (selector, options) {

if (settings.output && output.length > 0)
$(settings.output, context).val(JSON.stringify(output))

if (settings.onDrawEnd && typeof settings.onDrawEnd === 'function')
settings.onDrawEnd.apply(self)
}

/**
Expand Down Expand Up @@ -771,5 +772,7 @@ $.fn.signaturePad.defaults = {
, onBeforeValidate : null // Pass a callback to be used instead of the built-in function
, onFormError : null // Pass a callback to be used instead of the built-in function
, onDraw : null // Pass a callback to be used to capture the drawing process
, onDrawEnd : null // Pass a callback to be exectued after the drawing process
}

}(jQuery))

0 comments on commit f1d8798

Please sign in to comment.