mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
fix: #8188, fix bookmark if sorting is newest_to_oldest
This commit is contained in:
@@ -28,6 +28,8 @@ define('forum/topic/posts', [
|
||||
|
||||
updatePostCounts(data.posts);
|
||||
|
||||
updatePostIndices(data.posts);
|
||||
|
||||
ajaxify.data.postcount += 1;
|
||||
postTools.updatePostCount(ajaxify.data.postcount);
|
||||
|
||||
@@ -61,6 +63,16 @@ define('forum/topic/posts', [
|
||||
}
|
||||
}
|
||||
|
||||
function updatePostIndices(posts) {
|
||||
if (config.topicPostSort === 'newest_to_oldest') {
|
||||
posts[0].index = 1;
|
||||
components.get('post').not('[data-index=0]').each(function () {
|
||||
var newIndex = parseInt($(this).attr('data-index'), 10) + 1;
|
||||
$(this).attr('data-index', newIndex);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onNewPostPagination(data) {
|
||||
function scrollToPost() {
|
||||
scrollToPostIfSelf(data.posts[0]);
|
||||
|
||||
Reference in New Issue
Block a user