kopia lustrzana https://github.com/nextcloud/social
Scroll status into view on reply
Signed-off-by: Louis Chemineau <louis@chmn.me>pull/1696/head
rodzic
14ab49b5c6
commit
738204123c
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="post-content">
|
<div class="post-content" :data-social-status="item.id">
|
||||||
<div class="post-header">
|
<div class="post-header">
|
||||||
<div class="post-author-wrapper" :title="item.account.acct">
|
<div class="post-author-wrapper" :title="item.account.acct">
|
||||||
<router-link v-if="item.account"
|
<router-link v-if="item.account"
|
||||||
|
|
|
@ -74,7 +74,7 @@ export default {
|
||||||
// Make sure to scroll mainPost into view on first load so it is not hidden after the parents.
|
// Make sure to scroll mainPost into view on first load so it is not hidden after the parents.
|
||||||
parentsTimeline(_, previousValue) {
|
parentsTimeline(_, previousValue) {
|
||||||
if (previousValue.length === 0 && this.$refs.socialWrapper.parentElement.scrollTop === 0) {
|
if (previousValue.length === 0 && this.$refs.socialWrapper.parentElement.scrollTop === 0) {
|
||||||
this.$nextTick(() => this.$refs.mainPost.$el.scrollIntoView())
|
this.$nextTick(() => this.$refs.mainPost.$el.scrollIntoView({ behavior: 'smooth', block: 'center' }))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -91,6 +91,12 @@ export default {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.$root.$on('composer-reply', (item) => {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.socialWrapper.querySelector(`[data-social-status="${item.id}"]`).scrollIntoView({ behavior: 'smooth', block: 'center' })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
// Fetch information of the related account
|
// Fetch information of the related account
|
||||||
const response = await this.$store.dispatch(this.serverData.public ? 'fetchPublicAccountInfo' : 'fetchAccountInfo', this.account)
|
const response = await this.$store.dispatch(this.serverData.public ? 'fetchPublicAccountInfo' : 'fetchAccountInfo', this.account)
|
||||||
// We need to update this.uid because we may have asked info for an account whose domain part was a host-meta,
|
// We need to update this.uid because we may have asked info for an account whose domain part was a host-meta,
|
||||||
|
|
Ładowanie…
Reference in New Issue