mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
The 'reply' button shows the stream>topic or recipient(s) of the selected message, for better UX. It also expands to fill the remaining horizontal space in the button bar -- this should help make it easier for new users to figure out how to reply. Finally, it uses "Message" instead of "Reply", to better match the compose box. Fixes #17940.
26 lines
832 B
JavaScript
26 lines
832 B
JavaScript
import $ from "jquery";
|
|
|
|
import * as message_lists from "./message_lists";
|
|
|
|
function update_reply_recipient_label() {
|
|
const message = message_lists.current.selected_message();
|
|
let recipient_label = "";
|
|
if (message) {
|
|
if (message.stream && message.topic) {
|
|
recipient_label = "#" + message.stream + " > " + message.topic;
|
|
} else if (message.display_reply_to) {
|
|
recipient_label = message.display_reply_to;
|
|
}
|
|
}
|
|
$(".compose_reply_button_recipient_label").text(recipient_label);
|
|
}
|
|
|
|
// TODO: Move the closed-compose buttons click handlers here, probably.
|
|
|
|
export function initialize() {
|
|
// When the message selection changes, change the label on the Reply button.
|
|
$(document).on("message_selected.zulip", () => {
|
|
update_reply_recipient_label();
|
|
});
|
|
}
|