This commit is contained in:
Heiko Lübbe 2023-09-29 15:18:21 +02:00 committed by GitHub
commit 8551bfabc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -108,13 +108,13 @@
<script src="/infinite-scroll.js"></script>
<script type="text/javascript">
var lastPageLoaded = null;
var infScroll = new InfiniteScroll( '.container', {
// options
hideNav:'.pagination',
append: '.item',
history:false,
prefill:true,
checkLastPage: '.hacky_link', // check this selector string exists, as it is only set if nextPageLink exists
path: function(){
// need to query this DOM my damn self
var pageLinks = document.querySelectorAll('.hacky_link');
@ -124,7 +124,7 @@
}else{
var finalLink = pageLinks[pageLinks.length-1].href;
// make sure we don't load the same page twice
if (!finalLink || finalLink == window.location.href || finalLink == lastPageLoaded){
if (!finalLink || finalLink == window.location.href){
console.log('this was the last page');
return false;
}else{