compose: Update placeholder text depending on the narrow.

Change the `compose-textarea` placeholder text depending on the
stream/topic or PM recipients that the message will be sent to.

Resolves #12834.
This commit is contained in:
Vinit Singh
2019-07-23 23:43:43 +05:30
committed by Tim Abbott
parent 8f6f78b912
commit 03180752db
4 changed files with 114 additions and 0 deletions

View File

@@ -1074,6 +1074,16 @@ exports.initialize = function () {
})
);
$("#compose-textarea").focus(function () {
var opts = {
message_type: compose_state.get_message_type(),
stream: $('#stream_message_recipient_stream').val(),
topic: $('#stream_message_recipient_topic').val(),
private_message_recipient: compose_pm_pill.get_emails(),
};
compose_actions.update_placeholder_text(opts);
});
if (page_params.narrow !== undefined) {
if (page_params.narrow_topic !== undefined) {
compose_actions.start("stream", {topic: page_params.narrow_topic});