Commit 416ac5d4 authored by Andrii Marynets's avatar Andrii Marynets

Fix bug with reverse parameter in query string

parent 8ad5783b
......@@ -172,12 +172,19 @@ $('.text-white').on('click', function(e) {
if (media){res += 'media=' + media + '&'}
if (word){res += 'search=' + word + '&'}
var orderName = $(this).attr('href').replace("?order_by=", "")
if (order == orderName){res +='order_by=' + orderName + '&' + 'reverse=' + '1&'} else
var orderName = $(this).attr('href').replace("?order_by=", "");
if (order == orderName){
res +='order_by=' + orderName;
if (!reverse){
res += '&reverse=1';
}
}
else
{
res += 'order_by=' + orderName + '&'
res += 'order_by=' + orderName
}
console.log(res);
window.location.href = res;
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment