close on avatar click again, add zooming as option

This commit is contained in:
Henry Jameson 2022-06-27 19:52:40 +03:00
parent 700df11e9a
commit d232fa3dc3
7 changed files with 26 additions and 5 deletions

View File

@ -74,6 +74,11 @@
{{ $t('settings.show_scrollbars') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="userPopoverZoom">
{{ $t('settings.user_popover_avatar_zoom') }}
</BooleanSetting>
</li>
<li>
<ChoiceSetting
v-if="user"

View File

@ -38,7 +38,8 @@ export default {
'rounded',
'bordered',
'allowZoomingAvatar',
'onClose'
'onClose',
'onAvatarClick'
],
data () {
return {
@ -182,6 +183,12 @@ export default {
},
mentionUser () {
this.$store.dispatch('openPostStatusModal', { replyTo: true, repliedUser: this.user })
},
onAvatarClickHandler (e) {
if (this.onAvatarClick) {
e.preventDefault()
this.onAvatarClick()
}
}
}
}

View File

@ -30,6 +30,7 @@
<router-link
v-else
:to="userProfileLink(user)"
@click="onAvatarClickHandler"
>
<UserAvatar
:better-shadow="betterShadow"

View File

@ -4,11 +4,16 @@ import { defineAsyncComponent } from 'vue'
const UserPopover = {
name: 'UserPopover',
props: [
'userId', 'overlayCenters', 'disabled', 'overlay-centers-selector'
'userId', 'overlayCenters', 'disabled', 'overlayCentersSelector'
],
components: {
UserCard,
Popover: defineAsyncComponent(() => import('../popover/popover.vue'))
},
computed: {
userPopoverZoom () {
return this.$store.getters.mergedConfig.userPopoverZoom
}
}
}

View File

@ -2,7 +2,7 @@
<Popover
trigger="click"
popover-class="popover-default user-popover"
:overlay-centers-selector="overlayCentersSelector || '.user-info-avatar-link .Avatar'"
:overlay-centers-selector="overlayCentersSelector || '.user-info .Avatar'"
:overlay-centers="overlayCenters"
:disabled="disabled"
>
@ -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"
/>
</template>
</Popover>

View File

@ -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",

View File

@ -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