improve round number display

This commit is contained in:
Thibault Duplessis 2014-08-06 10:56:35 +02:00
parent eb155c5abb
commit 4c864d9999
2 changed files with 17 additions and 3 deletions

View file

@ -164,7 +164,7 @@ final class Env(
titivate.finishAbandoned
}
scheduler.message(0.9 seconds)(roundMap -> actorApi.BroadcastSize)
scheduler.message(1.3 seconds)(roundMap -> actorApi.BroadcastSize)
}
private lazy val titivate = new Titivate(roundMap, scheduler)

View file

@ -2453,8 +2453,22 @@ var storage = {
});
}, Math.round(Math.random() * 5000));
},
nbr: function(data) {
$('#site_baseline').show().find('span').text(data || '0');
nbr: function(e) {
var $tag = $('#site_baseline span');
if ($tag.length && e) {
var prev = parseInt($tag.text(), 10);
var k = 5;
var interv = 1200 / k;
_.each(_.range(k), function(it) {
setTimeout(function() {
var val = Math.round(((prev * (k - 1 - it)) + (e * (it + 1))) / k);
if (val != prev) {
$tag.text(val);
prev = val;
}
}, Math.round(it * interv));
});
}
}
},
options: {