Fix quote opening inside thread
This commit is contained in:
parent
553d4e7a02
commit
05982a10fc
1 changed files with 10 additions and 6 deletions
|
@ -26,7 +26,7 @@
|
||||||
title="Go to previous post"
|
title="Go to previous post"
|
||||||
@mouseover="highlight(post.in_reply_to_id)"
|
@mouseover="highlight(post.in_reply_to_id)"
|
||||||
@mouseleave="highlight(null)"
|
@mouseleave="highlight(null)"
|
||||||
@click="navigateTo($event, post.in_reply_to_id)"
|
@click.prevent="scrollTo(post.in_reply_to_id)"
|
||||||
>
|
>
|
||||||
<img :src="require('@/assets/tabler/corner-left-up.svg')">
|
<img :src="require('@/assets/tabler/corner-left-up.svg')">
|
||||||
</a>
|
</a>
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
class="timestamp"
|
class="timestamp"
|
||||||
:href="post.uri"
|
:href="post.uri"
|
||||||
:title="formatDate(post.created_at)"
|
:title="formatDate(post.created_at)"
|
||||||
@click="navigateTo($event, post.id)"
|
@click="openPost($event, post.id)"
|
||||||
>
|
>
|
||||||
{{ humanizeDate(post.created_at) }}
|
{{ humanizeDate(post.created_at) }}
|
||||||
</a>
|
</a>
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
class="post-quote"
|
class="post-quote"
|
||||||
:href="linkedPost.uri"
|
:href="linkedPost.uri"
|
||||||
:key="linkedPost.id"
|
:key="linkedPost.id"
|
||||||
@click="navigateTo($event, linkedPost.id)"
|
@click="openPost($event, linkedPost.id, true)"
|
||||||
>
|
>
|
||||||
<div class="quote-header">
|
<div class="quote-header">
|
||||||
<avatar :profile="linkedPost.account"></avatar>
|
<avatar :profile="linkedPost.account"></avatar>
|
||||||
|
@ -314,14 +314,18 @@ function highlight(postId: string | null) {
|
||||||
emit("highlight", postId)
|
emit("highlight", postId)
|
||||||
}
|
}
|
||||||
|
|
||||||
function navigateTo(event: Event, postId: string) {
|
function scrollTo(postId: string) {
|
||||||
|
emit("navigate-to", postId)
|
||||||
|
}
|
||||||
|
|
||||||
|
function openPost(event: Event, postId: string, forcePush = false) {
|
||||||
if (currentUser === null) {
|
if (currentUser === null) {
|
||||||
// Viewing as guest; do not override click handler
|
// Viewing as guest; do not override click handler
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
if (props.inThread) {
|
if (props.inThread && !forcePush) {
|
||||||
emit("navigate-to", postId)
|
scrollTo(postId)
|
||||||
} else {
|
} else {
|
||||||
router.push({ name: "post", params: { postId: postId } })
|
router.push({ name: "post", params: { postId: postId } })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue