Fix for issue 267, from Paul Felix
authorDan Vanderkam <danvk@google.com>
Thu, 26 Jan 2012 18:35:07 +0000 (13:35 -0500)
committerDan Vanderkam <danvk@google.com>
Thu, 26 Jan 2012 18:35:07 +0000 (13:35 -0500)
dygraph-range-selector.js

index 3c76338..9ae04d0 100644 (file)
@@ -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);
     }