From 99856327f03c525b878cb453f27a4e96ed2a415d Mon Sep 17 00:00:00 2001 From: evykassirer Date: Thu, 24 Oct 2024 13:15:46 -0700 Subject: [PATCH] buddy_list: Clicking avatar opens menu instead of using ... icon. --- web/src/user_card_popover.js | 7 +++++++ web/styles/right_sidebar.css | 25 +++++++++++++++++-------- web/templates/presence_row.hbs | 2 ++ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/web/src/user_card_popover.js b/web/src/user_card_popover.js index 270d8f68c5..01f6630a37 100644 --- a/web/src/user_card_popover.js +++ b/web/src/user_card_popover.js @@ -783,6 +783,13 @@ function register_click_handlers() { toggle_sidebar_user_card_popover($target); }); + $(".buddy-list-section").on("click", ".user-profile-picture", (e) => { + e.stopPropagation(); + const $target = $(e.currentTarget).closest("li"); + + toggle_sidebar_user_card_popover($target); + }); + $("body").on("click", ".sidebar-popover-mute-user", (e) => { const user_id = elem_to_user_id($(e.target).parents("ul")); hide_all_user_card_popovers(); diff --git a/web/styles/right_sidebar.css b/web/styles/right_sidebar.css index 7ac8c507dc..8e30af3435 100644 --- a/web/styles/right_sidebar.css +++ b/web/styles/right_sidebar.css @@ -170,8 +170,8 @@ $user_status_emoji_width: 24px; position: absolute; width: 0.4em; height: 0.4em; - top: 1.7em; - left: 1.7em; + top: 1.6em; + left: 1.6em; } .empty-list-message { @@ -254,12 +254,21 @@ $user_status_emoji_width: 24px; align-items: baseline; } -.user_sidebar_entry.with_avatar .selectable_sidebar_block { - margin: 3px; - grid-template: - "row-content markers-and-controls" var(--line-height-sidebar-row-with-avatars) - "row-content ." auto / minmax(0, 1fr) - minmax(0, auto); +.user_sidebar_entry.with_avatar { + grid-template: "row-content" var(--line-height-sidebar-row-with-avatars) "row-content" auto / minmax( + 0, + 1fr + ); + + .selectable_sidebar_block { + margin: 2px; + grid-template: + "row-content markers-and-controls" var( + --line-height-sidebar-row-with-avatars + ) + "row-content ." auto / minmax(0, 1fr) + minmax(0, auto); + } } .user-presence-link { diff --git a/web/templates/presence_row.hbs b/web/templates/presence_row.hbs index abb5f893df..dea8aec996 100644 --- a/web/templates/presence_row.hbs +++ b/web/templates/presence_row.hbs @@ -36,5 +36,7 @@ {{/if}} {{#if num_unread}}{{num_unread}}{{/if}} + {{#unless user_list_style.WITH_AVATAR}} + {{/unless}}