From 6b0652092ccb07c6452bddd8f8b239b3fe85e54e Mon Sep 17 00:00:00 2001 From: didier amyot Date: Tue, 12 Jul 2016 13:32:10 -0400 Subject: [PATCH] ordered the team results --- script/views/calendarPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/views/calendarPage.js b/script/views/calendarPage.js index b08e512..e4f26b1 100644 --- a/script/views/calendarPage.js +++ b/script/views/calendarPage.js @@ -26,6 +26,7 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo }; statsView.mainTable = function(stats){ + var orderedStats = _.reverse(_.sortBy(stats, ['victories', 'pointsFor'])); return m('table.uk-table.uk-table-hover.uk-table-striped',[ m('thead', m('tr', [ m('th', 'Équipes'), @@ -38,7 +39,7 @@ define(['m', '_', 'util', 'resultParser', 'teams', 'views/topNavBar', 'views/foo m('th', 'DIF'), m('th', 'PTS') ])), - m('tbody', _.map(stats, statsView.getStatRow)) + m('tbody', _.map(orderedStats, statsView.getStatRow)) ]); };