mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 20:41:17 +01:00
fix navigator.scrollToPost()
pagination and alternate sort page calculation
This commit is contained in:
@@ -210,7 +210,11 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com
|
||||
}
|
||||
|
||||
if (config.usePagination) {
|
||||
var page = Math.max(1, Math.ceil(postIndex / config.postsPerPage));
|
||||
var index = postIndex;
|
||||
if (config.topicPostSort === 'most_votes' || config.topicPostSort === 'newest_to_oldest') {
|
||||
index = ajaxify.data.postcount - 1 - index;
|
||||
}
|
||||
var page = Math.max(1, Math.ceil(index / config.postsPerPage));
|
||||
|
||||
if (parseInt(page, 10) !== ajaxify.data.pagination.currentPage) {
|
||||
pagination.loadPage(page, function() {
|
||||
|
||||
Reference in New Issue
Block a user