mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 11:08:54 +00:00
Shortcut sorting when simply toggling the order
This commit is contained in:
parent
70f2ea74a9
commit
d447dda941
1 changed files with 6 additions and 2 deletions
|
@ -92,8 +92,12 @@
|
|||
}
|
||||
var sortKey = sortBy + "-" + sortAscending;
|
||||
if (packages.sortKey === sortKey) return packages;
|
||||
if (packages.sortKey === sortBy + "-" + !sortAscending) {
|
||||
packages = packages.reverse();
|
||||
} else {
|
||||
var matched = _.sortBy(packages, function(p) { return p[sortBy](); });
|
||||
packages = savedSearches[t] = sortAscending ? matched : matched.reverse();
|
||||
}
|
||||
packages.sortKey = sortKey;
|
||||
return packages;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue