From d6130fa3815dc00466717239ae385ad38706f229 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 6 Feb 2021 20:06:03 -0700 Subject: [PATCH] Improve UX of signature pad --- www/assets/js/noticeslip.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/www/assets/js/noticeslip.js b/www/assets/js/noticeslip.js index 1f5eba4..dbac7fb 100644 --- a/www/assets/js/noticeslip.js +++ b/www/assets/js/noticeslip.js @@ -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"));