Skip to content

Commit

Permalink
Add 'data-default-order' attribute to sort buttons, PR javve#301 by @…
Browse files Browse the repository at this point in the history
  • Loading branch information
sheffieldnick committed Apr 3, 2020
1 parent 805e1bb commit ab88cbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sort.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ module.exports = function(list) {
} else if (list.utils.classes(btn).has('asc')) {
return "desc";
} else {
return "asc";
var defaultOrder = getAttribute(btn, 'data-default-order');
if (defaultOrder == "asc" || defaultOrder == "desc") {
return defaultOrder;
} else {
return "asc";
}
}
},
getInSensitive: function(btn, options) {
Expand Down

0 comments on commit ab88cbd

Please sign in to comment.