Update template.ejs
This commit is contained in:
parent
744a4b20b0
commit
758091e72e
|
@ -91,6 +91,39 @@
|
||||||
</div>
|
</div>
|
||||||
</div><!-- container -->
|
</div><!-- container -->
|
||||||
|
|
||||||
|
<% if ( isIndex ){ %>
|
||||||
|
<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,
|
||||||
|
path: function(){
|
||||||
|
// need to query this DOM my damn self
|
||||||
|
var pageLinks = document.querySelectorAll('.hacky_link');
|
||||||
|
if (!pageLinks || pageLinks.length == 0){
|
||||||
|
console.log ('next page link could not be found');
|
||||||
|
return false;
|
||||||
|
}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){
|
||||||
|
console.log('this was the last page');
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return finalLink;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<% } %>
|
||||||
|
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<!-- Old theme -->
|
<!-- Old theme -->
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue