This commit is contained in:
Ruben Daniels 2012-04-02 19:14:53 -07:00
commit c93c8d5d7f

View file

@ -700,7 +700,7 @@ var VirtualRenderer = function(container, theme) {
//@todo I would like to make this animation a setting. How? //@todo I would like to make this animation a setting. How?
var STEPS = 15; var STEPS = 9;
function calcSteps(fromValue, toValue){ function calcSteps(fromValue, toValue){
var i = 0, var i = 0,
l = STEPS - 1, l = STEPS - 1,
@ -725,12 +725,12 @@ var VirtualRenderer = function(container, theme) {
offset -= this.$size.scrollerHeight / 2; offset -= this.$size.scrollerHeight / 2;
var i = 0, _self = this, var i = 0, _self = this,
steps = calcSteps(this.scrollTop, offset); steps = calcSteps(this.scrollTop, offset); console.dir(steps);
clearInterval(_self.$timer); clearInterval(_self.$timer);
this.$timer = setInterval(function(){ this.$timer = setInterval(function(){
_self.session.setScrollTop(steps[i]); _self.session.setScrollTop(steps[i]);
if (++i == STEPS) if (++i == STEPS + 1)
clearInterval(_self.$timer); clearInterval(_self.$timer);
}, 10); }, 10);
}; };