From d232fa3dc3ff83a09a4ad583a123b419f4d4fa42 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 27 Jun 2022 19:52:40 +0300 Subject: [PATCH] close on avatar click again, add zooming as option --- src/components/settings_modal/tabs/general_tab.vue | 5 +++++ src/components/user_card/user_card.js | 9 ++++++++- src/components/user_card/user_card.vue | 1 + src/components/user_popover/user_popover.js | 7 ++++++- src/components/user_popover/user_popover.vue | 7 ++++--- src/i18n/en.json | 1 + src/modules/config.js | 1 + 7 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 61416394..0a300311 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -74,6 +74,11 @@ {{ $t('settings.show_scrollbars') }} +
  • + + {{ $t('settings.user_popover_avatar_zoom') }} + +
  • import('../popover/popover.vue')) + }, + computed: { + userPopoverZoom () { + return this.$store.getters.mergedConfig.userPopoverZoom + } } } diff --git a/src/components/user_popover/user_popover.vue b/src/components/user_popover/user_popover.vue index f4f505ae..c14cea4d 100644 --- a/src/components/user_popover/user_popover.vue +++ b/src/components/user_popover/user_popover.vue @@ -2,7 +2,7 @@ @@ -14,8 +14,9 @@ class="user-popover" :user-id="userId" :hide-bio="true" - :allow-zooming-avatar="true" - :onClose="close" + :allow-zooming-avatar="userPopoverZoom" + :on-avatar-click="userPopoverZoom ? null : close" + :on-close="close" /> diff --git a/src/i18n/en.json b/src/i18n/en.json index 5f3f1334..9a8e54d6 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -550,6 +550,7 @@ "mention_link_show_avatar": "Show user avatar beside the link", "mention_link_fade_domain": "Fade domains (e.g. {'@'}example.org in {'@'}foo{'@'}example.org)", "mention_link_bolden_you": "Highlight mention of you when you are mentioned", + "user_popover_avatar_zoom": "Clicking on user avatar in popover zooms it instead of closing the popover", "fun": "Fun", "greentext": "Meme arrows", "show_yous": "Show (You)s", diff --git a/src/modules/config.js b/src/modules/config.js index 6ae2e754..14add385 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -81,6 +81,7 @@ export const defaultState = { useContainFit: true, disableStickyHeaders: false, showScrollbars: false, + userPopoverZoom: false, greentext: undefined, // instance default useAtIcon: undefined, // instance default mentionLinkDisplay: undefined, // instance default