Skip to content
Permalink
Browse files

Fix post count retrieval when a thread only has one page

  • Loading branch information...
dorian-marchal committed Mar 26, 2016
1 parent 2d5fca9 commit 1d1697fb496c19d74687131dcce5c05b1d42f845
Showing with 13 additions and 2 deletions.
  1. +13 −2 Util.js
15 Util.js
@@ -54,7 +54,18 @@ SK.Util = {
callback(undefined);
}
else {
var pageCount = parseInt($m.find(".right-elt .lien-pagi").text());
var $lastPageLink = $m.find(".right-elt .lien-pagi").first();

// S'il n'y a pas de lien vers la dernière page, c'est que le
// topic n'a qu'une seule page.
if ($lastPageLink.length === 0) {
return callback({
pageCount: 1,
postCount: $m.find(".post").length,
});
}

var pageCount = parseInt($lastPageLink.text().trim(), 10);

//Récupération du nombre de posts de la dernière page
SK.Util.m(SK.common.getTopicUrlForPage(pageCount), function($m) {
@@ -71,7 +82,7 @@ SK.Util = {
else {
callback({
pageCount: pageCount,
postCount: fullPostCount
postCount: fullPostCount,
});
}
}

0 comments on commit 1d1697f

Please sign in to comment.
You can’t perform that action at this time.