mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
fix indices if postsPerPage is an odd number
This commit is contained in:
@@ -89,9 +89,9 @@ topicsController.get = function(req, res, next) {
|
|||||||
}
|
}
|
||||||
if (!settings.usePagination) {
|
if (!settings.usePagination) {
|
||||||
if (reverse) {
|
if (reverse) {
|
||||||
postIndex = Math.max(0, postCount - (req.params.post_index || postCount) - (settings.postsPerPage / 2));
|
postIndex = Math.max(0, postCount - (req.params.post_index || postCount) - Math.ceil(settings.postsPerPage / 2));
|
||||||
} else {
|
} else {
|
||||||
postIndex = Math.max(0, (req.params.post_index || 1) - (settings.postsPerPage / 2));
|
postIndex = Math.max(0, (req.params.post_index || 1) - Math.ceil(settings.postsPerPage / 2));
|
||||||
}
|
}
|
||||||
} else if (!req.query.page) {
|
} else if (!req.query.page) {
|
||||||
var index = 0;
|
var index = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user