1
0
Fork 0
forked from 0x2620/oxjs

less obscure Ox.map

This commit is contained in:
rolux 2012-05-22 16:29:37 +02:00
commit 12cf77cef5
21 changed files with 125 additions and 101 deletions

View file

@ -154,8 +154,8 @@ Ox.Chart = function(options, self) {
});
while (Ox.sum(widths) != totalWidth) {
max = Ox.max(widths);
maxKeys = Ox.map(Object.keys(widths), function(key) {
return widths[key] == max ? key : null;
maxKeys = Object.keys(widths).filter(function(key) {
return widths[key] == max;
});
widths[maxKeys[0]] += Ox.sum(widths) < totalWidth ? 1 : -1;
}