mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 19:36:41 +02:00
floating pinned articles to the top of the topic list
This commit is contained in:
@@ -85,10 +85,16 @@ var RDB = require('./redis.js'),
|
||||
'post_count' : postcount[i],
|
||||
'lock-icon': locked[i] === '1' ? 'icon-lock' : 'hide',
|
||||
'deleted': deleted[i],
|
||||
'pinned': parseInt(pinned[i] || 0), // For sorting purposes
|
||||
'pin-icon': pinned[i] === '1' ? 'icon-pushpin' : 'hide'
|
||||
});
|
||||
}
|
||||
|
||||
// Float pinned topics to the top
|
||||
topics = topics.sort(function(a, b) {
|
||||
return b.pinned - a.pinned;
|
||||
});
|
||||
|
||||
callback({
|
||||
'category_name' : category_id ? category_name : 'Recent',
|
||||
'show_topic_button' : category_id ? 'show' : 'hidden',
|
||||
|
||||
Reference in New Issue
Block a user