Skip to content
Snippets Groups Projects
Commit 433d09e8 authored by mattwire's avatar mattwire
Browse files

Switch to event.code from deprecated event.keyCode

parent 4d12caa5
No related branches found
No related tags found
1 merge request!1096.4
...@@ -321,8 +321,8 @@ CRM.$(function($) { ...@@ -321,8 +321,8 @@ CRM.$(function($) {
addDrupalWebformActionElement(this.value); addDrupalWebformActionElement(this.value);
}); });
// If enter pressed, use our submit function // If enter pressed, use our submit function
form.addEventListener('keydown', function (e) { form.addEventListener('keydown', function (event) {
if (e.keyCode === 13) { if (event.code === 'Enter') {
addDrupalWebformActionElement(this.value); addDrupalWebformActionElement(this.value);
submit(event); submit(event);
} }
...@@ -588,9 +588,9 @@ CRM.$(function($) { ...@@ -588,9 +588,9 @@ CRM.$(function($) {
function addSupportForCiviDiscount() { function addSupportForCiviDiscount() {
// Add a keypress handler to set flag if enter is pressed // Add a keypress handler to set flag if enter is pressed
cividiscountElements = form.querySelectorAll('input#discountcode'); cividiscountElements = form.querySelectorAll('input#discountcode');
var cividiscountHandleKeydown = function(e) { var cividiscountHandleKeydown = function(event) {
if (e.keyCode === 13) { if (event.code === 'Enter') {
e.preventDefault(); event.preventDefault();
debugging('adding submitdontprocess'); debugging('adding submitdontprocess');
form.dataset.submitdontprocess = true; form.dataset.submitdontprocess = true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment