🐛 Fixed infinitescroll when a paged url is loaded directly (#447)

closes #445
- added an fn to sanitize the pathname, that might include a pagination url
- fixed an issue, where the request would still be made if the current page is bigger than max pages
- added comments
This commit is contained in:
Aileen Nowak
2018-04-10 17:04:43 +08:00
committed by Kevin Ansfield
parent 41bcbb7157
commit d5002f2c51
2 changed files with 37 additions and 6 deletions

View File

@ -65,6 +65,9 @@
{{#if pagination.pages}}
<script>
// maxPages is a global variable that is needed to determine
// if we need to load more pages for the infinitescroll, or if
// we reached the last page already.
var maxPages = parseInt('{{pagination.pages}}');
</script>
<script src="{{asset "js/infinitescroll.js"}}"></script>