From: Dan Vanderkam Date: Thu, 26 Jan 2012 18:35:07 +0000 (-0500) Subject: Fix for issue 267, from Paul Felix X-Git-Tag: v1.0.0~332 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=e46e3d09ab519d3c154eca0df217b921d0e5b500;p=dygraphs.git Fix for issue 267, from Paul Felix --- diff --git a/dygraph-range-selector.js b/dygraph-range-selector.js index 3c76338..9ae04d0 100644 --- a/dygraph-range-selector.js +++ b/dygraph-range-selector.js @@ -255,7 +255,12 @@ DygraphRangeSelector.prototype.initInteraction_ = function() { return e.srcElement == self.iePanOverlay_; } else { // Getting clientX directly from the event is not accurate enough :( - var clientX = self.canvasRect_.x + (e.layerX !== undefined ? e.layerX : e.offsetX); + var clientX; + if (e.offsetX != undefined) { + clientX = self.canvasRect_.x + e.offsetX; + } else { + clientX = e.clientX; + } var zoomHandleStatus = self.getZoomHandleStatus_(); return (clientX > zoomHandleStatus.leftHandlePos && clientX < zoomHandleStatus.rightHandlePos); }