mirror of https://github.com/zulip/zulip.git
Disable message menu for locally echoed messages.
Wait until the server acks a message before we enable the message popover menu. This prevents a whole class of bugs related to re-drawing the message and changing the message id, and it also makes room for a little spinner in the future. Users with decent internet connections will generally get server responses before they can click on the chevron or hit esc/i, anyway.
This commit is contained in:
parent
94da59ff81
commit
d5d11ff181
|
@ -669,7 +669,7 @@ exports.process_hotkey = function (e, hotkey) {
|
||||||
// Shortcuts that operate on a message
|
// Shortcuts that operate on a message
|
||||||
switch (event_name) {
|
switch (event_name) {
|
||||||
case 'message_actions':
|
case 'message_actions':
|
||||||
return popovers.open_message_menu();
|
return popovers.open_message_menu(msg);
|
||||||
case 'star_message':
|
case 'star_message':
|
||||||
return message_flags.toggle_starred(msg);
|
return message_flags.toggle_starred(msg);
|
||||||
case 'narrow_by_recipient':
|
case 'narrow_by_recipient':
|
||||||
|
|
|
@ -232,8 +232,15 @@ function focus_first_action_popover_item() {
|
||||||
items.eq(0).expectOne().focus();
|
items.eq(0).expectOne().focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.open_message_menu = function () {
|
exports.open_message_menu = function (message) {
|
||||||
var id = current_msg_list.selected_id();
|
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);
|
popovers.toggle_actions_popover($(".selected_message .actions_hover")[0], id);
|
||||||
if (current_actions_popover_elem) {
|
if (current_actions_popover_elem) {
|
||||||
focus_first_action_popover_item();
|
focus_first_action_popover_item();
|
||||||
|
|
|
@ -48,9 +48,13 @@
|
||||||
<i class="icon-vector-smile" title="{{#tr this}}Add emoji reaction{{/tr}} (:)"></i>
|
<i class="icon-vector-smile" title="{{#tr this}}Add emoji reaction{{/tr}} (:)"></i>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#unless msg/locally_echoed}}
|
||||||
<div class="info actions_hover">
|
<div class="info actions_hover">
|
||||||
<i class="icon-vector-chevron-down" title="{{#tr this}}Message actions{{/tr}} (i)"></i>
|
<i class="icon-vector-chevron-down" title="{{#tr this}}Message actions{{/tr}} (i)"></i>
|
||||||
</div>
|
</div>
|
||||||
|
{{/unless}}
|
||||||
|
|
||||||
<div class="message_failed {{#unless msg.failed_request}}notvisible{{/unless}}">
|
<div class="message_failed {{#unless msg.failed_request}}notvisible{{/unless}}">
|
||||||
<i class="icon-vector-refresh refresh-failed-message" data-toggle="tooltip" title="{{t 'Retry' }}"></i>
|
<i class="icon-vector-refresh refresh-failed-message" data-toggle="tooltip" title="{{t 'Retry' }}"></i>
|
||||||
<i class="icon-vector-remove-sign remove-failed-message" data-toggle="tooltip" title="{{t 'Cancel' }}"></i>
|
<i class="icon-vector-remove-sign remove-failed-message" data-toggle="tooltip" title="{{t 'Cancel' }}"></i>
|
||||||
|
|
Loading…
Reference in New Issue