Fix Issue 145: Chrome/right-click seems to start implementing zoom bounding boxes.
authorDan Vanderkam <dan@dygraphs.com>
Thu, 22 Mar 2012 21:54:53 +0000 (17:54 -0400)
committerDan Vanderkam <dan@dygraphs.com>
Thu, 22 Mar 2012 21:54:53 +0000 (17:54 -0400)
dygraph-interaction-model.js

index 2790633..b6c19d2 100644 (file)
@@ -499,6 +499,9 @@ Dygraph.Interaction.endTouch = function(event, g, context) {
 Dygraph.Interaction.defaultModel = {
   // Track the beginning of drag events
   mousedown: function(event, g, context) {
+    // Right-click should not initiate a zoom.
+    if (event.button && event.button == 2) return;
+
     context.initializeMouseDown(event, g, context);
 
     if (event.altKey || event.shiftKey) {