Commit cb0efb72 authored by Antek Grzanka's avatar Antek Grzanka

Fixed #102.

parent f1a7cf77
(function(){
angular.module('ctfApp').controller('ScoreboardController', ['$scope', '$http', 'AppSettings', 'APIProvider', function($scope, $http, AppSettings, APIProvider) {
angular.module('ctfApp').controller('ScoreboardController', ['$scope', '$cookieStore', '$http', 'AppSettings', 'APIProvider',
function($scope, $cookieStore, $http, AppSettings, APIProvider) {
var calculatePerTeam = function(data) {
var teams = {};
......@@ -9,8 +10,7 @@
teams[team] = 0;
for (var level in data[team]){
if (data[team].hasOwnProperty(level)){
var score = data[team][level].map(function(o){return o.points;}).reduce(function(a,b){return a+b;});
teams[team] += score;
teams[team] += data[team][level];
}
}
}
......@@ -25,6 +25,7 @@
$('.column').each(function(){
$(this).animate({width: (100 * (parseFloat($(this).attr('data-score'))/maxValue)).toString() + '%'}, 1500);
});
$('#col-'+$cookieStore.get('teamname')).css('background-color', '#d33e44');
}
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment