if no sorting specificed let search plugins handle

This commit is contained in:
barisusakli
2016-08-23 19:59:25 +03:00
parent 31751c9d8a
commit 5d5b74f3ed

View File

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