mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 12:21:58 +00:00
web: Convert .data("message-id") to .attr.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
c97f6c6c71
commit
87ea4313cd
@@ -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);
|
||||
|
||||
@@ -241,7 +241,7 @@ export function is_emoji_present_in_text(text, emoji_dict) {
|
||||
function filter_emojis() {
|
||||
const $elt = $(".emoji-popover-filter").expectOne();
|
||||
const query = $elt.val().trim().toLowerCase();
|
||||
const message_id = $(".emoji-search-results-container").data("message-id");
|
||||
const message_id = Number($(".emoji-search-results-container").attr("data-message-id"));
|
||||
const search_results_visible = $(".emoji-search-results-container").is(":visible");
|
||||
if (query !== "") {
|
||||
const categories = complete_emoji_catalog;
|
||||
|
||||
@@ -125,7 +125,7 @@ export function initialize() {
|
||||
});
|
||||
|
||||
$popper.one("click", ".popover_edit_message, .popover_view_source", (e) => {
|
||||
const message_id = $(e.currentTarget).data("message-id");
|
||||
const message_id = Number($(e.currentTarget).attr("data-message-id"));
|
||||
assert(message_lists.current !== undefined);
|
||||
const $row = message_lists.current.get_row(message_id);
|
||||
message_edit.start($row);
|
||||
@@ -135,7 +135,7 @@ export function initialize() {
|
||||
});
|
||||
|
||||
$popper.one("click", ".popover_move_message", (e) => {
|
||||
const message_id = $(e.currentTarget).data("message-id");
|
||||
const message_id = Number($(e.currentTarget).attr("data-message-id"));
|
||||
assert(message_lists.current !== undefined);
|
||||
message_lists.current.select_id(message_id);
|
||||
const message = message_lists.current.get(message_id);
|
||||
@@ -151,7 +151,7 @@ export function initialize() {
|
||||
});
|
||||
|
||||
$popper.one("click", ".mark_as_unread", (e) => {
|
||||
const message_id = $(e.currentTarget).data("message-id");
|
||||
const message_id = Number($(e.currentTarget).attr("data-message-id"));
|
||||
unread_ops.mark_as_unread_from_here(message_id);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
@@ -159,7 +159,7 @@ export function initialize() {
|
||||
});
|
||||
|
||||
$popper.one("click", ".popover_toggle_collapse", (e) => {
|
||||
const message_id = $(e.currentTarget).data("message-id");
|
||||
const message_id = Number($(e.currentTarget).attr("data-message-id"));
|
||||
assert(message_lists.current !== undefined);
|
||||
const message = message_lists.current.get(message_id);
|
||||
assert(message !== undefined);
|
||||
@@ -174,7 +174,7 @@ export function initialize() {
|
||||
});
|
||||
|
||||
$popper.one("click", ".rehide_muted_user_message", (e) => {
|
||||
const message_id = $(e.currentTarget).data("message-id");
|
||||
const message_id = Number($(e.currentTarget).attr("data-message-id"));
|
||||
assert(message_lists.current !== undefined);
|
||||
const $row = message_lists.current.get_row(message_id);
|
||||
const message = message_lists.current.get(rows.id($row));
|
||||
@@ -190,7 +190,7 @@ export function initialize() {
|
||||
});
|
||||
|
||||
$popper.one("click", ".view_read_receipts", (e) => {
|
||||
const message_id = $(e.currentTarget).data("message-id");
|
||||
const message_id = Number($(e.currentTarget).attr("data-message-id"));
|
||||
read_receipts.show_user_list(message_id);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
@@ -198,7 +198,7 @@ export function initialize() {
|
||||
});
|
||||
|
||||
$popper.one("click", ".delete_message", (e) => {
|
||||
const message_id = $(e.currentTarget).data("message-id");
|
||||
const message_id = Number($(e.currentTarget).attr("data-message-id"));
|
||||
message_edit.delete_message(message_id);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
@@ -206,7 +206,7 @@ export function initialize() {
|
||||
});
|
||||
|
||||
$popper.one("click", ".reaction_button", (e) => {
|
||||
const message_id = $(e.currentTarget).data("message-id");
|
||||
const message_id = Number($(e.currentTarget).attr("data-message-id"));
|
||||
// Don't propagate the click event since `toggle_emoji_popover` opens a
|
||||
// emoji_picker which we don't want to hide after actions popover is hidden.
|
||||
e.stopPropagation();
|
||||
|
||||
Reference in New Issue
Block a user