diff --git a/tools/jslint/check-all.js b/tools/jslint/check-all.js index 88e27ac80e..072f1f8585 100644 --- a/tools/jslint/check-all.js +++ b/tools/jslint/check-all.js @@ -10,7 +10,7 @@ var globals = // compose.js + ' show_compose hide_compose toggle_compose compose_button' - + ' compose_stream_name validate_message' + + ' composing_message compose_stream_name validate_message' + ' status_classes' // dom_access.js diff --git a/zephyr/static/js/compose.js b/zephyr/static/js/compose.js index b4bcac8999..0b3302c8b9 100644 --- a/zephyr/static/js/compose.js +++ b/zephyr/static/js/compose.js @@ -42,6 +42,10 @@ function composing_huddle_message() { return $("#personal-message").is(":visible"); } +function composing_message() { + return composing_stream_message() || composing_huddle_message(); +} + function compose_stream_name() { return $.trim($("#stream").val()); } diff --git a/zephyr/static/js/hotkey.js b/zephyr/static/js/hotkey.js index bc2840ea5d..1085cb4d54 100644 --- a/zephyr/static/js/hotkey.js +++ b/zephyr/static/js/hotkey.js @@ -74,8 +74,12 @@ function process_hotkey(code) { select_message(get_last_visible(), false); } return false; - case 27: // Esc: hide compose pane - hide_compose(); + case 27: // Esc: hide compose pane or un-narrow + if (composing_message()) { + hide_compose(); + } else { + show_all_messages(); + } return process_hotkey; case 99: // 'c': compose compose_button();