diff --git a/resources/js/keyboardNavigation.js b/resources/js/keyboardNavigation.js index 2f768e0aa29adea1173ab16a3df0fac5221e7a2e..70c2e476eb0e51f27fb449f984e11f0a98c0f1c0 100644 --- a/resources/js/keyboardNavigation.js +++ b/resources/js/keyboardNavigation.js @@ -7,30 +7,29 @@ $(document).ready(function () { // Add entry point for tabbing to the first result $('.result, .ad').first().attr("id", "results-entry"); // Initially focus the searchbar - $('div.search-input input').focus(); }); /** * Simulate a click on enter keypress when focused on labels */ -$('label').on('keydown', function(e) { - if(e.keyCode == '13') { +$('label').on('keydown', function (e) { + if (e.keyCode == '13') { $(this).click(); $('a', this) } -}); +}); /** * Handles tab keypress and escape keypress */ -$(document).on('keydown', function(e) { +$(document).on('keydown', function (e) { e = e || window.event; // On first tab keypress there is special behaviour and the ctrlInfo flag is set - if(!ctrlInfo && e.keyCode == '9') { + if (!ctrlInfo && e.keyCode == '9') { focusNavBox(); e.preventDefault(); ctrlInfo = true; - } else if(e.keyCode == '27') { + } else if (e.keyCode == '27') { escKeyPressed(); } });