X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-range-selector.js;h=e2973b0d837422c3a8325077908b7f628970510b;hb=5baf7a08e52ae0c668c9578bdeb2d63b68f829fc;hp=0342ea721cb5b0ac224e0809968d0698dd34d9c6;hpb=42a9ebb8f492d2541a3904894447a7c74ba4cfd5;p=dygraphs.git diff --git a/dygraph-range-selector.js b/dygraph-range-selector.js index 0342ea7..e2973b0 100644 --- a/dygraph-range-selector.js +++ b/dygraph-range-selector.js @@ -179,6 +179,10 @@ DygraphRangeSelector.prototype.initInteraction_ = function() { var isPanning = false; var dynamic = !this.isMobileDevice_ && !this.isUsingExcanvas_; + // We cover iframes during mouse interactions. See comments in + // dygraph-utils.js for more info on why this is a good idea. + var tarp = new Dygraph.IFrameTarp(); + // functions, defined below. Defining them this way (rather than with // "function foo() {...}" makes JSHint happy. var toXDataWindow, onZoomStart, onZoom, onZoomEnd, doZoom, isMouseInPanZone, @@ -212,6 +216,7 @@ DygraphRangeSelector.prototype.initInteraction_ = function() { self.dygraph_.addEvent(topElem, 'mousemove', onZoom); self.dygraph_.addEvent(topElem, 'mouseup', onZoomEnd); self.fgcanvas_.style.cursor = 'col-resize'; + tarp.cover(); return true; }; @@ -256,6 +261,7 @@ DygraphRangeSelector.prototype.initInteraction_ = function() { return false; } isZooming = false; + tarp.uncover(); Dygraph.removeEvent(topElem, 'mousemove', onZoom); Dygraph.removeEvent(topElem, 'mouseup', onZoomEnd); self.fgcanvas_.style.cursor = 'default';