fix avatar not closing, add option to put popovers next to avatar
instead of over it
This commit is contained in:
parent
54ab1ed741
commit
2c3c2bb5b0
9 changed files with 33 additions and 15 deletions
|
|
@ -37,9 +37,8 @@ export default {
|
|||
'hideBio',
|
||||
'rounded',
|
||||
'bordered',
|
||||
'allowZoomingAvatar',
|
||||
'onClose',
|
||||
'onAvatarClick'
|
||||
'avatarAction', // default - open profile, 'zoom' - zoom, function - call function
|
||||
'onClose'
|
||||
],
|
||||
data () {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -133,23 +133,27 @@
|
|||
min-width: 0;
|
||||
}
|
||||
|
||||
> a {
|
||||
vertical-align: middle;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.Avatar {
|
||||
--_avatarShadowBox: var(--avatarShadow);
|
||||
--_avatarShadowFilter: var(--avatarShadowFilter);
|
||||
--_avatarShadowInset: var(--avatarShadowInset);
|
||||
|
||||
flex: 1 0 100%;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
&-avatar-link {
|
||||
&-avatar {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
&-overlay {
|
||||
&.-overlay {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
|
|
@ -169,7 +173,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
&:hover &-overlay {
|
||||
&:hover &.-overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,25 +12,31 @@
|
|||
<div class="user-info">
|
||||
<div class="container">
|
||||
<a
|
||||
v-if="allowZoomingAvatar"
|
||||
class="user-info-avatar-link"
|
||||
v-if="avatarAction === 'zoom'"
|
||||
class="user-info-avatar -link"
|
||||
@click="zoomAvatar"
|
||||
>
|
||||
<UserAvatar
|
||||
:better-shadow="betterShadow"
|
||||
:user="user"
|
||||
/>
|
||||
<div class="user-info-avatar-link-overlay">
|
||||
<div class="user-info-avatar -link -overlay">
|
||||
<FAIcon
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="search-plus"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
<UserAvatar
|
||||
v-else-if="typeof avatarAction === 'function'"
|
||||
@click="avatarAction"
|
||||
class="user-info-avatar"
|
||||
:better-shadow="betterShadow"
|
||||
:user="user"
|
||||
/>
|
||||
<router-link
|
||||
v-else
|
||||
:to="userProfileLink(user)"
|
||||
@click="onAvatarClickHandler"
|
||||
>
|
||||
<UserAvatar
|
||||
:better-shadow="betterShadow"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue