diff --git a/static/js/hotkey.js b/static/js/hotkey.js index 440169bd0b..79bc766aa5 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -669,7 +669,7 @@ exports.process_hotkey = function (e, hotkey) { // Shortcuts that operate on a message switch (event_name) { case 'message_actions': - return popovers.open_message_menu(); + return popovers.open_message_menu(msg); case 'star_message': return message_flags.toggle_starred(msg); case 'narrow_by_recipient': diff --git a/static/js/popovers.js b/static/js/popovers.js index 935262fabb..8360d6dac7 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -232,8 +232,15 @@ function focus_first_action_popover_item() { items.eq(0).expectOne().focus(); } -exports.open_message_menu = function () { - var id = current_msg_list.selected_id(); +exports.open_message_menu = function (message) { + if (message.locally_echoed) { + // Don't open the popup for locally echoed messages for now. + // It creates bugs with things like keyboard handlers when + // we get the server response. + return true; + } + + var id = message.id; popovers.toggle_actions_popover($(".selected_message .actions_hover")[0], id); if (current_actions_popover_elem) { focus_first_action_popover_item(); diff --git a/static/templates/single_message.handlebars b/static/templates/single_message.handlebars index 75504dd882..dd0648d2d8 100644 --- a/static/templates/single_message.handlebars +++ b/static/templates/single_message.handlebars @@ -48,9 +48,13 @@ {{/if}} + + {{#unless msg/locally_echoed}}