Files
zulip/static/js/compose_closed_ui.js
Ken Clary 74dbcdf2a8 frontend: Change 'reply' button label to reflect selected message.
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.
2021-05-03 14:58:02 -07:00

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();
});
}