summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2015-06-16 08:59:40 -0400
committerDavid Thompson <dthompson@vistahigherlearning.com>2015-06-16 08:59:40 -0400
commit2ba4aac538f378bc386281d42a3da1d21bb1601f (patch)
tree24cffe9b68124fdc5a2274041c5859e51aa7a8a7
parentdb77cdb53dd7ccb4319df4c19cf2e3b130331e9e (diff)
js: generations: List generations in reverse chronological order.
* js/controller/generations.js (guix.generations.controller): Render generations in reverse chronological order. [sortedGenerations]: New variable.
-rw-r--r--js/controller/generations.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/controller/generations.js b/js/controller/generations.js
index 2b17a59..5eb237f 100644
--- a/js/controller/generations.js
+++ b/js/controller/generations.js
@@ -17,8 +17,13 @@
guix.generations.controller = function() {
var generations = K.fromPromise(guix.generations.Generations());
+ var sortedGenerations = generations.map(function(generations) {
+ return _.sortBy(generations, function(g) {
+ return -g.number;
+ });
+ });
- return guix.ui.spinUntil(generations.map(function(generations) {
+ return guix.ui.spinUntil(sortedGenerations.map(function(generations) {
return [
guix.ui.headerWithBadge("Generations", generations.length),
m("table.table.table-bordered", [