diff --git a/zephyr/static/js/hotkey.js b/zephyr/static/js/hotkey.js index 259ba90623..20b33f1011 100644 --- a/zephyr/static/js/hotkey.js +++ b/zephyr/static/js/hotkey.js @@ -156,29 +156,29 @@ exports.set_compose = function () { so we bail in .keydown if the event is a letter or number and instead just let keypress go for it. */ -function down_or_press(event) { - var result = current_key_handler(event); +function down_or_press(e) { + var result = current_key_handler(e); if (result) { current_key_handler = result; - event.preventDefault(); + e.preventDefault(); } } -$(document).keydown(function (event) { +$(document).keydown(function (e) { // Restrict to non-alphanumeric keys - if (48 > event.which || 90 < event.which) - down_or_press(event); + if (48 > e.which || 90 < e.which) + down_or_press(e); }); -$(document).keypress(function (event) { +$(document).keypress(function (e) { // What exactly triggers .keypress may vary by browser. // Welcome to compatability hell. // // In particular, when you press tab in Firefox, it fires a // keypress event with keycode 0 after processing the original // event. - if (event.which !== 0 && event.charCode !== 0) - down_or_press(event); + if (e.which !== 0 && e.charCode !== 0) + down_or_press(e); }); return exports;