From c0e02726be4058dd349d54d26ce4fd609de96ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Tue, 23 Dec 2014 17:33:13 +0100 Subject: [PATCH] Fix categories order on dashboard --- front/src/js/controllers/dashboardCtrl.js | 3 +++ front/src/views/dashboard.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/front/src/js/controllers/dashboardCtrl.js b/front/src/js/controllers/dashboardCtrl.js index db1c4dd..12c269c 100644 --- a/front/src/js/controllers/dashboardCtrl.js +++ b/front/src/js/controllers/dashboardCtrl.js @@ -20,6 +20,9 @@ dashboardCtrl.controller('DashboardCtrl', ['$scope', '$rootScope', '$routeParams } function init() { + // By default, Angular sorts object's attributes alphabetically. Countering this problem by retrieving the keys order here. + $scope.categoriesOrder = Object.keys($scope.result.scoreProfiles.generic.categories); + $scope.globalScore = Math.max($scope.result.scoreProfiles.generic.globalScore, 0); $scope.tweetText = 'My website\'s score is ' + $scope.globalScore + '/100 on #YellowLabTools!'; } diff --git a/front/src/views/dashboard.html b/front/src/views/dashboard.html index 5f504d0..896ee77 100644 --- a/front/src/views/dashboard.html +++ b/front/src/views/dashboard.html @@ -11,7 +11,7 @@

Score details

-
+
{{category.label}}