mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-10 16:47:36 +01:00
sort numerically
This commit is contained in:
@@ -101,8 +101,8 @@ define('forum/topic/fork', function() {
|
||||
post.css('opacity', '1.0');
|
||||
}
|
||||
|
||||
if(pids.length) {
|
||||
pids.sort();
|
||||
if (pids.length) {
|
||||
pids.sort(function(a,b) { return a - b; });
|
||||
forkModal.find('#fork-pids').html(pids.toString());
|
||||
} else {
|
||||
showNoPostsSelected();
|
||||
|
||||
@@ -28,7 +28,9 @@ module.exports = function(Topics) {
|
||||
return callback(new Error('[[error:invalid-pid]]'));
|
||||
}
|
||||
|
||||
pids.sort();
|
||||
pids.sort(function(a, b) {
|
||||
return a - b;
|
||||
});
|
||||
var mainPid = pids[0];
|
||||
|
||||
async.parallel({
|
||||
|
||||
Reference in New Issue
Block a user