web: Convert .data("message-id") to .attr.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-05-02 17:05:20 -07:00
committed by Tim Abbott
parent c97f6c6c71
commit 87ea4313cd
3 changed files with 13 additions and 13 deletions

View File

@@ -255,10 +255,10 @@ export function reify_message_id(opts: {old_id: number; new_id: number}): void {
// update that link as well
for (const e of $("#compose_banners a")) {
const $elem = $(e);
const message_id = $elem.data("message-id");
const message_id = Number($elem.attr("data-message-id"));
if (message_id === old_id) {
$elem.data("message-id", new_id);
$elem.attr("data-message-id", new_id);
compose_banner.set_scroll_to_message_banner_message_id(new_id);
}
}
@@ -273,7 +273,7 @@ export function initialize(opts: {
"click",
".narrow_to_recipient .above_compose_banner_action_link, .automatic_new_visibility_policy .above_compose_banner_action_link",
(e) => {
const message_id = $(e.currentTarget).data("message-id");
const message_id = Number($(e.currentTarget).attr("data-message-id"));
on_narrow_to_recipient(message_id);
e.stopPropagation();
e.preventDefault();
@@ -284,7 +284,7 @@ export function initialize(opts: {
".sent_scroll_to_view .above_compose_banner_action_link",
(e) => {
assert(message_lists.current !== undefined);
const message_id = $(e.currentTarget).data("message-id");
const message_id = Number($(e.currentTarget).attr("data-message-id"));
message_lists.current.select_id(message_id);
on_click_scroll_to_selected();
compose_banner.clear_message_sent_banners(false);