sistemato bug di scambio tab in caso non ci fossero nuovi post e aggiunto reset paginazione quando si cambia tab

This commit is contained in:
cek@posta.indivia.net 2017-03-29 22:29:15 +02:00
parent eb24381f2f
commit 1eb104b450
2 changed files with 12 additions and 2 deletions

View file

@ -103,7 +103,7 @@ var appendPostList = function(div, resultSet, categories, fallback) {
var prependPostsList = function(div, resultSet, categories, fallback) {
var type = getObjKey(FONTE.categories, categories);
$(div).empty();
//$(div).empty();
if (resultSet.rows.length > 0) {
FONTE.page_loaded[type]++;
drawListPost(div, resultSet, 'prepend');

View file

@ -62,6 +62,8 @@ function update() {
}
function postsUpdate(categories) {
$(FONTE.contentListClass).empty();
var storage = window.localStorage;
var type = getObjKey(FONTE.categories, categories);
var jsonurl = weburl + REST_PARAMS.posts + REST_PARAMS.per_page + "&categories=" + categories.join(',');
@ -177,6 +179,10 @@ function getPrevSinglePageRecur(url, pagenum, categories) {
}
function getLastSinglePageRecur(url, pagenum, categories) {
// resetto la paginazione di #info e #ilove
FONTE.page_loaded.info = 0;
FONTE.page_loaded.ilove = 0;
var type = getObjKey(FONTE.categories, categories);
console.log('url:'+url);
@ -238,7 +244,11 @@ function getLastSinglePageRecur(url, pagenum, categories) {
insertOrUpdateCatToPost(id, val);
});
});
if (data.length == 0) {
renderLastNews(FONTE.contentListClass, categories);
}
},
error: JSONErrorHandler
});
}
}