From: Klaus Weidner Date: Wed, 29 Feb 2012 00:06:32 +0000 (-0800) Subject: Fix stuck fading animation for series highlighting X-Git-Tag: v1.0.0~314^2~3^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=1d44ee5e30ce80a7cbd2700b102df72fabccedc3;p=dygraphs.git Fix stuck fading animation for series highlighting The animateId field wasn't being initialized correctly if clearSelection() got called before the first call to setSelection(). TODO(klausw): add more generic support for animating changes to option values? --- diff --git a/dygraph.js b/dygraph.js index bc830b2..d79fa88 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1851,10 +1851,8 @@ Dygraph.prototype.setLegendHTML_ = function(x, sel_points) { Dygraph.prototype.animateSelection_ = function(direction) { var totalSteps = 10; var millis = 30; - if (this.fadeLevel === undefined) { - this.fadeLevel = 0; - this.animateId = 0; - } + if (this.fadeLevel === undefined) this.fadeLevel = 0; + if (this.animateId === undefined) this.animateId = 0; var start = this.fadeLevel; var steps = direction < 0 ? start : totalSteps - start; if (steps <= 0) {