Change default sort on group view screen
Hi,
I am trying to change the default sort by behaviour on the pad list of a group, but I cannot figure out how yet.
I've been tweaking the code here, but the default behaviour is still the same:
git diff frontend/js/modules/group-view.js
diff --git a/frontend/js/modules/group-view.js b/frontend/js/modules/group-view.js
index 8bc8242..47f31e7 100644
--- a/frontend/js/modules/group-view.js
+++ b/frontend/js/modules/group-view.js
@@ -79,7 +79,7 @@ module.exports = (function () {
c.isAdmin = false;
c.pads = ld.sortBy(ld.compact(ld.map(c.group.pads, function (x) {
return data.pads()[x];
- })), 'ctime');
+ })), 'ctime', 'desc');
}
document.title = conf.LANG.GROUP.GROUP + ' ' + c.group.name +
' - ' + conf.SERVER.title;
@@ -158,7 +158,7 @@ module.exports = (function () {
var data = c.isGuest ? model.tmp() : model;
c.group = data.groups()[key];
c.pads = ld.sortBy(ld.compact(ld.map(c.group.pads,
- function (x) { return data.pads()[x]; })), 'ctime');
+ function (x) { return data.pads()[x]; })), 'ctime', 'desc');
c.sendPass(true);
});
};