Created
January 9, 2019 19:41
-
-
Save beckyresler/63f5a95d45df45b6feff2508dd350e4d to your computer and use it in GitHub Desktop.
WP eSignature Plugin - Fix for line breaks in textareas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$(document).ready(function () { | |
makeSignatureKeyboardAccessible(); | |
}); | |
function makeSignatureKeyboardAccessible() { | |
var signaturePopup = $('.signature-wrapper-displayonly'); | |
if (signaturePopup) { | |
signaturePopup.attr('tabindex', 0); | |
} | |
$(document).on('keypress', signaturePopup, function (e) { | |
var code = e.keyCode || e.which; | |
var tag = e.target.tagName.toLowerCase(); | |
if (code == 13 && tag != 'textarea') { | |
signaturePopup.click(); | |
} | |
}); | |
} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added line 17 in the above code and modified line 19.