if no sorting specificed let search plugins handle

v1.18.x
barisusakli 9 years ago
parent 31751c9d8a
commit 5d5b74f3ed

@ -298,10 +298,10 @@ function filterByTimerange(posts, timeRange, timeFilter) {
} }
function sortPosts(posts, data) { function sortPosts(posts, data) {
if (!posts.length) { if (!posts.length || !data.sortBy) {
return; return;
} }
data.sortBy = data.sortBy || 'timestamp';
data.sortDirection = data.sortDirection || 'desc'; data.sortDirection = data.sortDirection || 'desc';
var direction = data.sortDirection === 'desc' ? 1 : -1; var direction = data.sortDirection === 'desc' ? 1 : -1;

Loading…
Cancel
Save