Do not use Function.prototype.bind in examples
PhantomJS 1.x does not have Function.prototype.bind, so do not use that function in examples.
This commit is contained in:
@@ -33,10 +33,11 @@ Progress.prototype.addLoading = function() {
|
|||||||
* Increment the count of loaded tiles.
|
* Increment the count of loaded tiles.
|
||||||
*/
|
*/
|
||||||
Progress.prototype.addLoaded = function() {
|
Progress.prototype.addLoaded = function() {
|
||||||
|
var this_ = this;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
++this.loaded;
|
++this_.loaded;
|
||||||
this.update();
|
this_.update();
|
||||||
}.bind(this), 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +50,10 @@ Progress.prototype.update = function() {
|
|||||||
if (this.loading === this.loaded) {
|
if (this.loading === this.loaded) {
|
||||||
this.loading = 0;
|
this.loading = 0;
|
||||||
this.loaded = 0;
|
this.loaded = 0;
|
||||||
setTimeout(this.hide.bind(this), 500);
|
var this_ = this;
|
||||||
|
setTimeout(function() {
|
||||||
|
this_.hide();
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,11 @@ Progress.prototype.addLoading = function() {
|
|||||||
* Increment the count of loaded tiles.
|
* Increment the count of loaded tiles.
|
||||||
*/
|
*/
|
||||||
Progress.prototype.addLoaded = function() {
|
Progress.prototype.addLoaded = function() {
|
||||||
|
var this_ = this;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
++this.loaded;
|
++this_.loaded;
|
||||||
this.update();
|
this_.update();
|
||||||
}.bind(this), 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +50,10 @@ Progress.prototype.update = function() {
|
|||||||
if (this.loading === this.loaded) {
|
if (this.loading === this.loaded) {
|
||||||
this.loading = 0;
|
this.loading = 0;
|
||||||
this.loaded = 0;
|
this.loaded = 0;
|
||||||
setTimeout(this.hide.bind(this), 500);
|
var this_ = this;
|
||||||
|
setTimeout(function() {
|
||||||
|
this_.hide();
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user