diff --git a/www/js/query.js b/www/js/query.js index 520819e..4b4fe81 100644 --- a/www/js/query.js +++ b/www/js/query.js @@ -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'); diff --git a/www/js/update.js b/www/js/update.js index 3fd7fc3..c980bd1 100644 --- a/www/js/update.js +++ b/www/js/update.js @@ -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 }); -} \ No newline at end of file +}