From e1c4c7b802a87cb3dafcde439ed017090bceec71 Mon Sep 17 00:00:00 2001 From: Signior-X Date: Wed, 17 Mar 2021 07:20:55 +0530 Subject: [PATCH] message view: Show message source button until message successfully sent. This commit removes the unless msg/locally_echoed condition for the edit content div, which has the consequence of making the "view message source" widget always available for locally echoed messages. This ensures that the message source can be seen if a very long message has been drafted and it fails due to a server-side error (See #17425 for the original report). Fixes #17650. --- static/js/ui_init.js | 7 +++---- static/templates/message_controls.hbs | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/static/js/ui_init.js b/static/js/ui_init.js index 27d9def8f7..45e260f8b8 100644 --- a/static/js/ui_init.js +++ b/static/js/ui_init.js @@ -95,14 +95,13 @@ function message_hover(message_row) { if (current_message_hover && rows.id(current_message_hover) === id) { return; } - // Don't allow on-hover editing for local-only messages - if (message_row.hasClass("local")) { - return; - } + const message = current_msg_list.get(rows.id(message_row)); message_unhover(); current_message_hover = message_row; + // Locally echoed messages have !is_topic_editable and thus go + // through this code path. if (!message_edit.is_topic_editable(message)) { // The actions and reactions icon hover logic is handled entirely by CSS return; diff --git a/static/templates/message_controls.hbs b/static/templates/message_controls.hbs index 5b887263e9..2884752961 100644 --- a/static/templates/message_controls.hbs +++ b/static/templates/message_controls.hbs @@ -1,8 +1,6 @@
{{#if msg/sent_by_me}} - {{#unless msg/locally_echoed}} -
- {{/unless}} +
{{/if}} {{#unless msg/sent_by_me}}