X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=3fad0d6d5daa91e01d942944403dd4e66cc6e736;hb=9f636500f08868182ecd88288636e7f8718e28de;hp=64ca4b67b287c577bd4ea83d749fdb8857e95600;hpb=f4e7e19ad631619a3f73a2393704a4f70bbd1bae;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 64ca4b6..3fad0d6 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1247,6 +1247,10 @@ Dygraph.prototype.createDragInterface_ = function() { boundedDates: null, // [minDate, maxDate] boundedValues: null, // [[minValue, maxValue] ...] + // We cover iframes during mouse interactions. See comments in + // dygraph-utils.js for more info on why this is a good idea. + tarp: new Dygraph.IFrameTarp(), + // contextB is the same thing as this context object but renamed. initializeMouseDown: function(event, g, contextB) { // prevents mouse drags from selecting page text. @@ -1262,6 +1266,7 @@ Dygraph.prototype.createDragInterface_ = function() { contextB.dragStartX = g.dragGetX_(event, contextB); contextB.dragStartY = g.dragGetY_(event, contextB); contextB.cancelNextDblclick = false; + contextB.tarp.cover(); } }; @@ -1301,9 +1306,11 @@ Dygraph.prototype.createDragInterface_ = function() { delete self.axes_[i].dragValueRange; } } + + context.tarp.uncover(); }; - this.addEvent(window, 'mouseup', this.mouseUpHandler_); + this.addEvent(document, 'mouseup', this.mouseUpHandler_); }; /** @@ -2099,7 +2106,7 @@ Dygraph.prototype.extremeValues_ = function(series) { // With custom bars, maxY is the max of the high values. for (j = 0; j < series.length; j++) { y = series[j][1][0]; - if (!y) continue; + if (y === null || isNaN(y)) continue; var low = y - series[j][1][1]; var high = y + series[j][1][2]; if (low > y) low = y; // this can happen with custom bars, @@ -2348,6 +2355,7 @@ Dygraph.prototype.drawGraph_ = function() { } this.computeYAxisRanges_(extremes); + console.log(extremes); this.layout_.setYAxes(this.axes_); this.addXTicks_();