Improve UX of signature pad

This commit is contained in:
Skylar Ittner 2021-02-06 20:06:03 -07:00
parent 579a4d2032
commit d6130fa381

View File

@ -12,7 +12,11 @@ function initSignaturePad() {
var canvas = document.getElementById("signaturecanvas");
resizeCanvas(canvas);
signaturePad = new SignaturePad(canvas, {
backgroundColor: 'rgba(255, 255, 255, 0.5)'
backgroundColor: 'rgba(255, 255, 255, 0.5)',
onBegin: function () {
// stop page from jumping around if user starts drawing signature while a text box is focused
$("input").blur();
}
});
}
@ -220,7 +224,6 @@ $("#app").on("click", "#signatureUndoBtn", function () {
signaturePad.fromData(data);
}
});
//$(window).on("resize", function () {
// if (signaturePad != null) {
// resizeCanvas(document.getElementById("signaturecanvas"));