Fix runaway trashcan lid task (issue 261 on code.google.com).

This commit is contained in:
Neil Fraser
2015-01-26 06:06:46 -08:00
parent aa5afd18f6
commit 03e53d2d68
2 changed files with 2 additions and 2 deletions

View File

@@ -279,7 +279,7 @@ Blockly.Trashcan.prototype.animateLid_ = function() {
(this.LID_HEIGHT_ - 2) + ')');
var opacity = goog.math.lerp(0.2, 0.4, this.lidOpen_);
this.svgGroup_.style.opacity = opacity;
if (this.lidOpen_ > 0 || this.lidOpen_ < 1) {
if (this.lidOpen_ > 0 && this.lidOpen_ < 1) {
this.lidTask_ = goog.Timer.callOnce(this.animateLid_, 20, this);
}
};