user-card-tooltip: Open user card when user-card-tooltip visible.

Without hovering on the name or profile picture user-card-tooltip
was visible but on_click user card does not open.

To fix it message-avatar class is added in the
register_click_handlers function.
This commit is contained in:
kash2104
2025-03-25 20:23:34 +05:30
committed by Tim Abbott
parent 0e7a5c1774
commit 3243d278e2

View File

@@ -661,19 +661,15 @@ function toggle_sidebar_user_card_popover($target: JQuery): void {
}
function register_click_handlers(): void {
$("#main_div").on(
"click",
".sender_name, .inline_profile_picture",
function (this: HTMLElement, e) {
const $row = $(this).closest(".message_row");
e.stopPropagation();
assert(message_lists.current !== undefined);
const message = message_lists.current.get(rows.id($row));
assert(message !== undefined);
const user = people.get_by_user_id(message.sender_id);
toggle_user_card_popover_for_message(this, user, message.sender_id, true);
},
);
$("#main_div").on("click", ".sender_name, .message-avatar", function (this: HTMLElement, e) {
const $row = $(this).closest(".message_row");
e.stopPropagation();
assert(message_lists.current !== undefined);
const message = message_lists.current.get(rows.id($row));
assert(message !== undefined);
const user = people.get_by_user_id(message.sender_id);
toggle_user_card_popover_for_message(this, user, message.sender_id, true);
});
$("#main_div").on("click", ".user-mention", function (this: HTMLElement, e) {
const id_string = $(this).attr("data-user-id");