Skip to content

Commit

Permalink
feat: Provide a new TimeLine component (close #909)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Aug 24, 2024
1 parent 5c844a8 commit fa4ff45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/client/components/collection/KScrollDown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function scrollOnce () {
const targetElement = document.getElementById(props.target)
if (!targetElement) return
const position = qScrollUtils.getVerticalScrollPosition(targetElement)
qScrollUtils.setVerticalScrollPosition(targetElement, position + targetElement.offsetHeight, props.duration)
qScrollUtils.setVerticalScrollPosition(targetElement, position + targetElement.offsetHeight * .75, props.duration)
refresh()
}
Expand Down
6 changes: 6 additions & 0 deletions core/client/components/collection/KTimeLine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ function onScroll () {
if (scrollToTopRef.value) scrollToTopRef.value.refresh()
}
function onLoad (index, done) {
// check whether the items are all loaded yet
if (items.value.length === nbTotalItems.value) {
done(true)
return
}
// set the current page and tell the collection to be refreshed
currentPage.value = index
refreshCollection()
loadDoneFunction.value = done
Expand Down

0 comments on commit fa4ff45

Please sign in to comment.