fix(PublicPage): infinite scrolling last page issue
This commit is contained in:
parent
922b3caa28
commit
c1d2457bff
1 changed files with 5 additions and 7 deletions
|
@ -254,6 +254,7 @@ function renderMosaic(data) {
|
||||||
// 1 - parse all the data
|
// 1 - parse all the data
|
||||||
// 2 - for each
|
// 2 - for each
|
||||||
currentOrganizations = data
|
currentOrganizations = data
|
||||||
|
page = 0
|
||||||
pageCount = Math.floor(data.length / elementsPerPage)
|
pageCount = Math.floor(data.length / elementsPerPage)
|
||||||
renderPage()
|
renderPage()
|
||||||
if (currentCardContainer !== null) {
|
if (currentCardContainer !== null) {
|
||||||
|
@ -264,16 +265,13 @@ function renderMosaic(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onscroll = () => {
|
window.onscroll = () => {
|
||||||
if (focusPoint != null) {
|
if (focusPoint != null && isVisible(focusPoint) && !rendering) {
|
||||||
//console.log(isVisible(focusPoint))
|
if (page + 1 < pageCount + 1) {
|
||||||
if (isVisible(focusPoint) && !rendering) {
|
|
||||||
if ((page + 1) < pageCount) {
|
|
||||||
page++
|
page++
|
||||||
renderPage()
|
renderPage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch tags and register click handler
|
* Fetch tags and register click handler
|
||||||
|
|
Loading…
Reference in a new issue