From 11f746f3ea945e264f22921bcc587350a5385102 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 27 Oct 2012 19:34:22 +0200 Subject: [PATCH] fix a bug in statistics dialog --- static/js/pandora/statisticsDialog.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/js/pandora/statisticsDialog.js b/static/js/pandora/statisticsDialog.js index b8f48f29..aaffcc7b 100644 --- a/static/js/pandora/statisticsDialog.js +++ b/static/js/pandora/statisticsDialog.js @@ -509,8 +509,9 @@ pandora.ui.statisticsDialog = function() { Ox.Chart({ color: function(value) { var color = Ox.zip(value.split(' / ').map(function(v, i) { + var key = ['system', 'browser'][i]; v = version ? getName(key, v) : v; - return colors[i == 0 ? 'system' : 'browser'][v]; + return colors[key][v]; })).map(function(c) { return Math.round(Ox.sum(c) / 2); }); @@ -547,12 +548,12 @@ pandora.ui.statisticsDialog = function() { ) ); value.split(' / ').forEach(function(value, i) { + var key = ['system', 'browser'][i]; value = version ? getName(key, value) : value; $element.append( $('') .attr({ - src: Ox.UI.PATH + 'png/' - + (i == 0 ? 'system' : 'browser') + src: Ox.UI.PATH + 'png/' + key + value.replace(/ /g, '') + '128.png' }) .css({