From 1d44ee5e30ce80a7cbd2700b102df72fabccedc3 Mon Sep 17 00:00:00 2001 From: Klaus Weidner Date: Tue, 28 Feb 2012 16:06:32 -0800 Subject: [PATCH] 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? --- dygraph.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) { -- 2.7.4