mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 21:06:16 +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
|
// update that link as well
|
||||||
for (const e of $("#compose_banners a")) {
|
for (const e of $("#compose_banners a")) {
|
||||||
const $elem = $(e);
|
const $elem = $(e);
|
||||||
const message_id = $elem.data("message-id");
|
const message_id = Number($elem.attr("data-message-id"));
|
||||||
|
|
||||||
if (message_id === old_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);
|
compose_banner.set_scroll_to_message_banner_message_id(new_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,7 @@ export function initialize(opts: {
|
|||||||
"click",
|
"click",
|
||||||
".narrow_to_recipient .above_compose_banner_action_link, .automatic_new_visibility_policy .above_compose_banner_action_link",
|
".narrow_to_recipient .above_compose_banner_action_link, .automatic_new_visibility_policy .above_compose_banner_action_link",
|
||||||
(e) => {
|
(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);
|
on_narrow_to_recipient(message_id);
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -284,7 +284,7 @@ export function initialize(opts: {
|
|||||||
".sent_scroll_to_view .above_compose_banner_action_link",
|
".sent_scroll_to_view .above_compose_banner_action_link",
|
||||||
(e) => {
|
(e) => {
|
||||||
assert(message_lists.current !== undefined);
|
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);
|
message_lists.current.select_id(message_id);
|
||||||
on_click_scroll_to_selected();
|
on_click_scroll_to_selected();
|
||||||
compose_banner.clear_message_sent_banners(false);
|
compose_banner.clear_message_sent_banners(false);
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ export function is_emoji_present_in_text(text, emoji_dict) {
|
|||||||
function filter_emojis() {
|
function filter_emojis() {
|
||||||
const $elt = $(".emoji-popover-filter").expectOne();
|
const $elt = $(".emoji-popover-filter").expectOne();
|
||||||
const query = $elt.val().trim().toLowerCase();
|
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");
|
const search_results_visible = $(".emoji-search-results-container").is(":visible");
|
||||||
if (query !== "") {
|
if (query !== "") {
|
||||||
const categories = complete_emoji_catalog;
|
const categories = complete_emoji_catalog;
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export function initialize() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$popper.one("click", ".popover_edit_message, .popover_view_source", (e) => {
|
$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);
|
assert(message_lists.current !== undefined);
|
||||||
const $row = message_lists.current.get_row(message_id);
|
const $row = message_lists.current.get_row(message_id);
|
||||||
message_edit.start($row);
|
message_edit.start($row);
|
||||||
@@ -135,7 +135,7 @@ export function initialize() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$popper.one("click", ".popover_move_message", (e) => {
|
$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);
|
assert(message_lists.current !== undefined);
|
||||||
message_lists.current.select_id(message_id);
|
message_lists.current.select_id(message_id);
|
||||||
const message = message_lists.current.get(message_id);
|
const message = message_lists.current.get(message_id);
|
||||||
@@ -151,7 +151,7 @@ export function initialize() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$popper.one("click", ".mark_as_unread", (e) => {
|
$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);
|
unread_ops.mark_as_unread_from_here(message_id);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@@ -159,7 +159,7 @@ export function initialize() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$popper.one("click", ".popover_toggle_collapse", (e) => {
|
$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);
|
assert(message_lists.current !== undefined);
|
||||||
const message = message_lists.current.get(message_id);
|
const message = message_lists.current.get(message_id);
|
||||||
assert(message !== undefined);
|
assert(message !== undefined);
|
||||||
@@ -174,7 +174,7 @@ export function initialize() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$popper.one("click", ".rehide_muted_user_message", (e) => {
|
$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);
|
assert(message_lists.current !== undefined);
|
||||||
const $row = message_lists.current.get_row(message_id);
|
const $row = message_lists.current.get_row(message_id);
|
||||||
const message = message_lists.current.get(rows.id($row));
|
const message = message_lists.current.get(rows.id($row));
|
||||||
@@ -190,7 +190,7 @@ export function initialize() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$popper.one("click", ".view_read_receipts", (e) => {
|
$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);
|
read_receipts.show_user_list(message_id);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@@ -198,7 +198,7 @@ export function initialize() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$popper.one("click", ".delete_message", (e) => {
|
$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);
|
message_edit.delete_message(message_id);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@@ -206,7 +206,7 @@ export function initialize() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$popper.one("click", ".reaction_button", (e) => {
|
$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
|
// 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.
|
// emoji_picker which we don't want to hide after actions popover is hidden.
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|||||||
Reference in New Issue
Block a user