Fix pagination

This commit is contained in:
Flavio Copes
2017-05-31 18:13:17 +02:00
parent 85c94ef44b
commit 15cb9c62be
2 changed files with 3 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ var isLoading = false;
var filters = {};
var global_index = 1;
var files_ended = false;
const MEDIA_PAGINATION_INTERVAL = 10;
/* handle changing file type / date filter */
$('body').on('change', '.thumbs-list-container select.filter', (event) => {
@@ -177,7 +178,7 @@ var loadNextBatch = function loadNextBatch(callback) {
}
loadMedia({}, function(content) {
if (!$(content).length) {
if (!$(content).length || ((content.split('card-item').length - 1) < MEDIA_PAGINATION_INTERVAL)) {
files_ended = true;
} else {
if (callback) {

File diff suppressed because one or more lines are too long