mirror of
https://github.com/elk-zone/elk
synced 2024-11-24 07:06:08 +09:00
fix: tapping on avatar should show switcher on mobile
This commit is contained in:
parent
9687330dd4
commit
834eca2ad2
@ -24,7 +24,7 @@ const nav = ref<HTMLDivElement>()
|
|||||||
</div>
|
</div>
|
||||||
<div flex items-center>
|
<div flex items-center>
|
||||||
<slot name="actions" />
|
<slot name="actions" />
|
||||||
<NavUser v-if="isSmallScreen" :nav="nav" />
|
<NavUser v-if="isSmallScreen" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<slot name="header" />
|
<slot name="header" />
|
||||||
|
@ -4,16 +4,7 @@ import type { ComponentPublicInstance } from 'vue'
|
|||||||
const avatar = ref<ComponentPublicInstance>()
|
const avatar = ref<ComponentPublicInstance>()
|
||||||
const switcher = ref()
|
const switcher = ref()
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const goProfile = () => {
|
|
||||||
router.push(`/@${currentUser.value!.account.username}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
let showSwitcher = $ref(false)
|
let showSwitcher = $ref(false)
|
||||||
onLongPress(avatar, () => {
|
|
||||||
showSwitcher = true
|
|
||||||
})
|
|
||||||
|
|
||||||
onClickOutside(avatar, () => {
|
onClickOutside(avatar, () => {
|
||||||
showSwitcher = false
|
showSwitcher = false
|
||||||
@ -26,6 +17,7 @@ onClickOutside(avatar, () => {
|
|||||||
v-model:shown="showSwitcher"
|
v-model:shown="showSwitcher"
|
||||||
:triggers="[]"
|
:triggers="[]"
|
||||||
:auto-hide="false"
|
:auto-hide="false"
|
||||||
|
@click="showSwitcher = true"
|
||||||
>
|
>
|
||||||
<div style="-webkit-touch-callout: none;">
|
<div style="-webkit-touch-callout: none;">
|
||||||
<AccountAvatar
|
<AccountAvatar
|
||||||
@ -33,7 +25,6 @@ onClickOutside(avatar, () => {
|
|||||||
:account="currentUser.account"
|
:account="currentUser.account"
|
||||||
h="2em"
|
h="2em"
|
||||||
:draggable="false"
|
:draggable="false"
|
||||||
@click.stop="goProfile"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user