compose: Add url to 'scroll down' sent banner.

This notification ("scroll down to view your message" with a link
for the user to click to scroll down) was added in e2c388c and
removed in 657e1f1 in a commit almost immediately afterwards.

Later the notification was added again, but there was notably no
link to scroll, just the message to scroll down. 372cb20

The link to scroll down was "added" in 1a63c2d when it was fixing
a similar link in another notification. But the implementation
didn't actually use the link (because there was no classname passed
through).

This commit adds a classname so that the link is clickable by
the user.

Fixes part of #19857.
This commit is contained in:
evykassirer 2022-12-15 14:21:36 -08:00 committed by Tim Abbott
parent ff89590558
commit fbad0b273b
1 changed files with 10 additions and 3 deletions

View File

@ -611,11 +611,19 @@ export function notify_local_mixes(messages, need_user_to_scroll) {
let reason = get_local_notify_mix_reason(message);
const above_composebox_narrow_url = get_above_composebox_narrow_url(message);
const link_msg_id = message.id;
if (!reason) {
if (need_user_to_scroll) {
reason = $t({defaultMessage: "Sent! Scroll down to view your message."});
notify_above_composebox(reason, "", above_composebox_narrow_url, null, "");
reason = $t({defaultMessage: "Sent!"});
const link_text = $t({defaultMessage: "Scroll down to view your message."});
notify_above_composebox(
reason,
"compose_notification_scroll_to_message",
above_composebox_narrow_url,
link_msg_id,
link_text,
);
setTimeout(() => {
$("#out-of-view-notification").hide();
}, 3000);
@ -626,7 +634,6 @@ export function notify_local_mixes(messages, need_user_to_scroll) {
continue;
}
const link_msg_id = message.id;
const link_class = "compose_notification_narrow_by_topic";
const link_text = $t(
{defaultMessage: "Narrow to {message_recipient}"},