diff --git a/tools/jslint/check-all.js b/tools/jslint/check-all.js index a5da83f2a6..ba3171339b 100644 --- a/tools/jslint/check-all.js +++ b/tools/jslint/check-all.js @@ -36,6 +36,7 @@ var globals = + ' register_onclick hide_email show_email' + ' report_error report_success report_message clicking mouse_moved' + ' update_autocomplete autocomplete_needs_update' + + ' userinfo_currently_popped' // zephyr.js + ' message_array message_dict get_updates_params' diff --git a/zephyr/static/js/hotkey.js b/zephyr/static/js/hotkey.js index 573d5997f6..945515fa0c 100644 --- a/zephyr/static/js/hotkey.js +++ b/zephyr/static/js/hotkey.js @@ -91,8 +91,11 @@ function process_hotkey(code) { select_message(rows.last_visible(), {then_scroll: false}); } return false; - case 27: // Esc: cancel compose or un-narrow - if (compose.composing()) { + case 27: // Esc: close userinfo popup, cancel compose, or un-narrow + if (userinfo_currently_popped !== undefined) { + userinfo_currently_popped.popover("destroy"); + userinfo_currently_popped = undefined; + } else if (compose.composing()) { compose.cancel(); } else { narrow.show_all_messages(); diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index c66c0f23f9..552b2e8a23 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -256,6 +256,7 @@ function userinfo_popover(event, element, id) { // One popover at a time. if (userinfo_currently_popped) { userinfo_currently_popped.popover("destroy"); + userinfo_currently_popped = undefined; } var message = message_dict[id]; elt.popover({placement: "bottom",