mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
fix sort by vote insertion
This commit is contained in:
@@ -292,7 +292,7 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
|
|||||||
function findInsertionPoint() {
|
function findInsertionPoint() {
|
||||||
var firstPostTimestamp = parseInt(data.posts[0].timestamp, 10);
|
var firstPostTimestamp = parseInt(data.posts[0].timestamp, 10);
|
||||||
var firstPostVotes = parseInt(data.posts[0].votes, 10);
|
var firstPostVotes = parseInt(data.posts[0].votes, 10);
|
||||||
var firstPostPid = parseInt(data.posts[0].pid, 10);
|
var firstPostIndex = parseInt(data.posts[0].index, 10);
|
||||||
|
|
||||||
var firstReply = $('#post-container li.post-row[data-index!="0"]').first();
|
var firstReply = $('#post-container li.post-row[data-index!="0"]').first();
|
||||||
var lastReply = $('#post-container li.post-row[data-index!="0"]').last();
|
var lastReply = $('#post-container li.post-row[data-index!="0"]').last();
|
||||||
@@ -315,9 +315,9 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
|
|||||||
} else if(firstPostVotes < parseInt(firstReply.attr('data-votes'), 10)) {
|
} else if(firstPostVotes < parseInt(firstReply.attr('data-votes'), 10)) {
|
||||||
after = lastReply;
|
after = lastReply;
|
||||||
} else {
|
} else {
|
||||||
if (firstPostPid <= parseInt(firstReply.attr('data-pid'), 10)) {
|
if (firstPostIndex > parseInt(firstReply.attr('data-index'), 10)) {
|
||||||
before = firstReply;
|
before = firstReply;
|
||||||
} else if(firstPostPid > parseInt(firstReply.attr('data-pid'), 10)) {
|
} else if(firstPostIndex <= parseInt(firstReply.attr('data-index'), 10)) {
|
||||||
after = lastReply;
|
after = lastReply;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user