Skip to content

Commit

Permalink
#1804 Fix case template quick sort options
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Feb 24, 2021
1 parent 3f88d17 commit b7b0580
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,18 @@
});
};

this.sortBy = function(sort) {
self.list.sort = sort;
self.list.update();
self.filtering.setSort(sort);
};

this.sortByField = function(field) {
var context = this.filtering.context;
var currentSort = Array.isArray(context.sort) ? context.sort[0] : context.sort;
var sort = null;

if(currentSort && currentSort.substr(1) !== field) {
if(currentSort.substr(1) !== field) {
sort = ['+' + field];
} else {
sort = [(currentSort === '+' + field) ? '-'+field : '+'+field];
Expand Down

0 comments on commit b7b0580

Please sign in to comment.