Fix issue when tot files < pagination interval

This commit is contained in:
Flavio Copes
2017-05-31 22:28:31 +02:00
parent 1b39ccf05d
commit 27899aa08e
2 changed files with 7 additions and 5 deletions

View File

@@ -186,7 +186,6 @@ var loadNextBatch = function loadNextBatch(callback) {
}
}
});
};
var fillView = function fillView() {
@@ -212,6 +211,9 @@ var disableInfiniteScrolling = function disableInfiniteScrolling() {
};
$('.js__files').on('fillView', function(event) {
fillView();
enableInfiniteScrolling();
// the first batch got the max number of media files, try loading more
if (($('.js__files')[0].innerHTML.split('card-item').length - 1) === MEDIA_PAGINATION_INTERVAL) {
fillView();
enableInfiniteScrolling();
}
});

File diff suppressed because one or more lines are too long