scroll.
This commit is contained in:
parent
725bec1293
commit
b7943cac84
5 changed files with 34 additions and 22 deletions
|
|
@ -133,6 +133,7 @@ export default {
|
|||
// # Main things
|
||||
const {
|
||||
currentStatus,
|
||||
mainStatus,
|
||||
conversation,
|
||||
replies,
|
||||
getReplies,
|
||||
|
|
@ -201,7 +202,7 @@ export default {
|
|||
const isLinearView = computed(() => displayStyle.value !== 'tree')
|
||||
const linearElement = useTemplateRef('linear')
|
||||
const linearScrollCompensation = computed(
|
||||
() => isLinearView.value && isExpanded.value,
|
||||
() => isLinearView.value,
|
||||
)
|
||||
const {
|
||||
heightChart: heightChartLinear,
|
||||
|
|
@ -214,20 +215,11 @@ export default {
|
|||
body: linearElement,
|
||||
scrollPositionInstance: scroller,
|
||||
scrollCompensation: linearScrollCompensation,
|
||||
anchorId: currentStatus.id,
|
||||
anchorId: mainStatus.value?.id,
|
||||
anchorRepeatId: currentStatus.value?.id,
|
||||
getPlaceholderHeight,
|
||||
})
|
||||
|
||||
watch(
|
||||
expanded,
|
||||
async (value) => {
|
||||
pauseWatchers()
|
||||
await tryScrollTo(currentStatus.value.id)
|
||||
resumeWatchers()
|
||||
},
|
||||
{ flush: 'post' },
|
||||
)
|
||||
|
||||
// # Tree style stuff
|
||||
const isTreeView = computed(() => displayStyle.value === 'tree')
|
||||
const {
|
||||
|
|
@ -241,7 +233,7 @@ export default {
|
|||
|
||||
const ancestorsElement = useTemplateRef('ancestors')
|
||||
const treeScrollCompensation = computed(
|
||||
() => isTreeView.value && isExpanded.value,
|
||||
() => isTreeView.value,
|
||||
)
|
||||
const {
|
||||
heightChart: heightChartAncestors,
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@
|
|||
:focused="focused === element.item.id"
|
||||
conversation-rank="ancestor"
|
||||
:data-status-id="element.id"
|
||||
:data-vs-height="element.height"
|
||||
:data-vs-top="element.top"
|
||||
|
||||
@goto="setFocused"
|
||||
@dive="diveIntoStatus(element.item.id)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue