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.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) {