X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=4502bd41f72f101111316f5f52c82a146f404888;hb=daab85060912edf8b14c7315a40b3cbe9e923c07;hp=6ae12c340f849dd75117eb51de6b62c788ed0bcd;hpb=54f4c379dcad2be2e6b2922b9e25e46352ee604d;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 6ae12c3..4502bd4 100644 --- a/dygraph.js +++ b/dygraph.js @@ -190,7 +190,7 @@ Dygraph.numberValueFormatter = function(x, opts) { * @private */ Dygraph.numberAxisLabelFormatter = function(x, granularity, opts) { - return Dygraph.numberValueFormatter(x, opts); + return Dygraph.numberValueFormatter.call(this, x, opts); }; /** @@ -2019,6 +2019,14 @@ Dygraph.prototype.animateSelection_ = function(direction) { var thisId = ++this.animateId; var that = this; + var cleanupIfClearing = function() { + // if we haven't reached fadeLevel 0 in the max frame time, + // ensure that the clear happens and just go to 0 + if (that.fadeLevel !== 0 && direction < 0) { + that.fadeLevel = 0; + that.clearSelection(); + } + }; Dygraph.repeatAndCleanup( function(n) { // ignore simultaneous animations @@ -2031,7 +2039,7 @@ Dygraph.prototype.animateSelection_ = function(direction) { that.updateSelection_(that.fadeLevel / totalSteps); } }, - steps, millis, function() {}); + steps, millis, cleanupIfClearing); }; /**