disable timer

This commit is contained in:
Fabian Jakobs 2010-09-24 07:48:20 +02:00
commit 65d3586d45

View file

@ -204,25 +204,27 @@ var VirtualRenderer = function(container) {
}; };
this.draw = function(scrollOnly, callback) { this.draw = function(scrollOnly, callback) {
if (this.$drawTimer) { this.$draw(scrollOnly);
clearInterval(this.$drawTimer); callback && callback();
this.scrollOnly = this.scrollOnly && scrollOnly; // if (this.$drawTimer) {
} else { // clearInterval(this.$drawTimer);
this.scollOnly = scrollOnly; // this.scrollOnly = this.scrollOnly && scrollOnly;
} // } else {
// this.scollOnly = scrollOnly;
if (callback) // }
this.$drawCallbacks.push(callback); //
// if (callback)
var _self = this; // this.$drawCallbacks.push(callback);
this.$drawTimer = setTimeout(function() { //
_self.$draw(_self.scrollOnly); // var _self = this;
for (var i=0; i<_self.$drawCallbacks.length; i++) // this.$drawTimer = setTimeout(function() {
_self.$drawCallbacks[i](); // _self.$draw(_self.scrollOnly);
// for (var i=0; i<_self.$drawCallbacks.length; i++)
_self.$drawCallbacks = []; // _self.$drawCallbacks[i]();
delete _self.$drawTimer; //
}, 0); // _self.$drawCallbacks = [];
// delete _self.$drawTimer;
// }, 0);
}; };
this.$draw = function(scrollOnly) { this.$draw = function(scrollOnly) {