diff --git a/tools/jslint/check-all.js b/tools/jslint/check-all.js index b27cfc2884..873de335c1 100644 --- a/tools/jslint/check-all.js +++ b/tools/jslint/check-all.js @@ -21,6 +21,7 @@ var globals = // hotkey.js + ' process_goto_hotkey process_compose_hotkey process_key_in_input' + + ' set_compose_hotkey' // narrow.js + ' narrow_target_message_id narrowed show_all_messages' diff --git a/zephyr/static/js/compose.js b/zephyr/static/js/compose.js index 50dfb2e423..4e479f63a0 100644 --- a/zephyr/static/js/compose.js +++ b/zephyr/static/js/compose.js @@ -23,6 +23,7 @@ function compose_button(tabname) { clear_compose_box(); $('#sidebar a[href="#home"]').tab('show'); show_compose(tabname, $("#" + tabname)); + set_compose_hotkey(); } function toggle_compose() { diff --git a/zephyr/static/js/hotkey.js b/zephyr/static/js/hotkey.js index a35325a906..6c113028cb 100644 --- a/zephyr/static/js/hotkey.js +++ b/zephyr/static/js/hotkey.js @@ -142,6 +142,10 @@ function process_compose_hotkey(code) { return process_hotkey(code); } +function set_compose_hotkey() { + keydown_handler = process_compose_hotkey; +} + $(document).keydown(function (e) { pressed_keys[e.which] = true; });