From 2ba4aac538f378bc386281d42a3da1d21bb1601f Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 16 Jun 2015 08:59:40 -0400 Subject: js: generations: List generations in reverse chronological order. * js/controller/generations.js (guix.generations.controller): Render generations in reverse chronological order. [sortedGenerations]: New variable. --- js/controller/generations.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'js/controller') 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", [ -- cgit v1.2.3