diff --git a/static/js/popovers.js b/static/js/popovers.js index 5a68f4d4f4..96fb04b079 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -893,7 +893,7 @@ exports.register_click_handlers = function () { e.preventDefault(); }); - $("body").on("click", ".info_popover_actions .view_user_profile", (e) => { + $("body").on("click", ".info_popover_actions .view_full_user_profile", (e) => { const user_id = elem_to_user_id($(e.target).parents("ul")); const user = people.get_by_user_id(user_id); exports.show_user_profile(user); @@ -913,10 +913,12 @@ exports.register_click_handlers = function () { }); }); - $("body").on("click", ".bot-owner-name", (e) => { + $("body").on("click", ".view_user_profile", (e) => { const user_id = parseInt($(e.target).attr("data-user-id"), 10); const user = people.get_by_user_id(user_id); exports.show_user_info_popover(e.target, user); + e.stopPropagation(); + e.preventDefault(); }); $("body").on("click", "#user-profile-modal #name #edit-button", () => { diff --git a/static/js/settings_users.js b/static/js/settings_users.js index a8fcb98844..919e544b7f 100644 --- a/static/js/settings_users.js +++ b/static/js/settings_users.js @@ -583,16 +583,6 @@ function handle_reactivation(tbody, status_field) { }); } -function handle_bot_owner_profile(tbody) { - tbody.on("click", ".user_row .view_user_profile", (e) => { - const owner_id = parseInt($(e.target).attr("data-user-id"), 10); - const owner = people.get_by_user_id(owner_id); - popovers.show_user_info_popover(e.target, owner); - e.stopPropagation(); - e.preventDefault(); - }); -} - function handle_human_form(tbody, status_field) { tbody.on("click", ".open-user-form", (e) => { e.stopPropagation(); @@ -686,7 +676,6 @@ section.bots.handle_events = () => { const tbody = $("#admin_bots_table").expectOne(); const status_field = $("#bot-field-status").expectOne(); - handle_bot_owner_profile(tbody); handle_bot_deactivation(tbody, status_field); handle_reactivation(tbody, status_field); handle_bot_form(tbody, status_field); diff --git a/static/templates/user_info_popover_content.hbs b/static/templates/user_info_popover_content.hbs index bffea34b55..76814701be 100644 --- a/static/templates/user_info_popover_content.hbs +++ b/static/templates/user_info_popover_content.hbs @@ -35,7 +35,7 @@ {{#if is_bot}} {{#if bot_owner}}
  • {{#tr this}}Owner{{/tr}}: - +
  • @@ -92,7 +92,7 @@
    {{#if show_user_profile}}
  • - + {{#if is_me}} {{#tr this}}View your profile{{/tr}} {{else}}