floating pinned articles to the top of the topic list

v1.18.x
Julian Lam 12 years ago
parent 387419ef64
commit b57109f6fd

@ -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',

Loading…
Cancel
Save