Merge pull request #60 from muhme/master
fix #23 Last feed entry is duplicated infinitely
This commit is contained in:
commit
34f5503804
|
@ -108,13 +108,13 @@
|
||||||
<script src="/infinite-scroll.js"></script>
|
<script src="/infinite-scroll.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var lastPageLoaded = null;
|
|
||||||
var infScroll = new InfiniteScroll( '.container', {
|
var infScroll = new InfiniteScroll( '.container', {
|
||||||
// options
|
// options
|
||||||
hideNav:'.pagination',
|
hideNav:'.pagination',
|
||||||
append: '.item',
|
append: '.item',
|
||||||
history:false,
|
history:false,
|
||||||
prefill:true,
|
prefill:true,
|
||||||
|
checkLastPage: '.hacky_link', // check this selector string exists, as it is only set if nextPageLink exists
|
||||||
path: function(){
|
path: function(){
|
||||||
// need to query this DOM my damn self
|
// need to query this DOM my damn self
|
||||||
var pageLinks = document.querySelectorAll('.hacky_link');
|
var pageLinks = document.querySelectorAll('.hacky_link');
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
}else{
|
}else{
|
||||||
var finalLink = pageLinks[pageLinks.length-1].href;
|
var finalLink = pageLinks[pageLinks.length-1].href;
|
||||||
// make sure we don't load the same page twice
|
// 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');
|
console.log('this was the last page');
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Reference in New Issue