popovers: Use e.currentTarget for .view_user_profile event listener.

The previous version with e.target would give the element that was
clicked lying inside an element with '.view_user_profile'.

One would usually expect "data-user-id" to be attached to the
same element with ".view_user_profile" instead of any of its children.
So, to just look for "data-user-id" in the element with that class,
instead of any of its chidren, this commit changes e.target to
e.currentTarget.
This commit is contained in:
Dinesh 2022-04-26 11:14:33 +05:30 committed by Tim Abbott
parent 43fb872f3f
commit 63d71ecb0c
1 changed files with 1 additions and 1 deletions

View File

@ -974,7 +974,7 @@ export function register_click_handlers() {
});
$("body").on("click", ".view_user_profile", (e) => {
const user_id = Number.parseInt($(e.target).attr("data-user-id"), 10);
const user_id = Number.parseInt($(e.currentTarget).attr("data-user-id"), 10);
const user = people.get_by_user_id(user_id);
show_user_info_popover(e.target, user);
e.stopPropagation();