diff --git a/open-isle-cli/src/views/PostPageView.vue b/open-isle-cli/src/views/PostPageView.vue index 311383bcf..d527320f8 100644 --- a/open-isle-cli/src/views/PostPageView.vue +++ b/open-isle-cli/src/views/PostPageView.vue @@ -89,7 +89,7 @@
loading...
-
{{ postTime }}
+
{{ scrollerTopTime }}
@@ -323,6 +323,12 @@ export default { const lastReplyTime = computed(() => comments.value.length ? comments.value[comments.value.length - 1].time : postTime.value ) + const firstReplyTime = computed(() => + comments.value.length ? comments.value[0].time : postTime.value + ) + const scrollerTopTime = computed(() => + commentSort.value === 'OLDEST' ? postTime.value : firstReplyTime.value + ) watch( () => comments.value.length, @@ -351,8 +357,10 @@ export default { } } - const onSliderInput = () => { - const target = postItems.value[currentIndex.value - 1] + const onSliderInput = (e) => { + const index = Number(e.target.value) + currentIndex.value = index + const target = postItems.value[index - 1] if (target && mainContainer.value) { const top = getTopRelativeTo(target, mainContainer.value) mainContainer.value.scrollTo({ top, behavior: 'instant' }) @@ -584,6 +592,7 @@ export default { tags, comments, postTime, + scrollerTopTime, lastReplyTime, postItems, mainContainer,