Fix error when sorting Job list by object.
[ganeti_webmgr.git] / ganeti_web / static / js / sorter.js
blob464d208990faf4fbc60539bab07cdc6f73409f39
1 function sort(url, old_order, new_order) { 
2     var order = getOrderAscDesc(old_order, new_order);
3     location.href = url.replace(old_order, order);
4
6 function getOrderAscDesc(old_order, new_order) {
7     if (old_order == new_order) {
8         return '-' + old_order;
9     }
10     else {
11         return new_order;
12     }