fix pageCount calculation

This commit is contained in:
Barış Soner Uşaklı
2018-01-23 15:52:54 -05:00
parent d70cdf1e28
commit 813fdaf6f6
3 changed files with 3 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ define('forum/topic/posts', [
var posts = data.posts;
ajaxify.data.pagination.pageCount = Math.max(1, Math.ceil((posts[0].topic.postcount - 1) / config.postsPerPage));
ajaxify.data.pagination.pageCount = Math.max(1, Math.ceil(posts[0].topic.postcount / config.postsPerPage));
var direction = config.topicPostSort === 'oldest_to_newest' || config.topicPostSort === 'most_votes' ? 1 : -1;
var isPostVisible = (ajaxify.data.pagination.currentPage === ajaxify.data.pagination.pageCount && direction === 1) ||