if (regionWidth >= 10 && context.dragDirection == Dygraph.HORIZONTAL) {
g.doZoomX_(Math.min(context.dragStartX, context.dragEndX),
Math.max(context.dragStartX, context.dragEndX));
+ context.cancelNextDblclick = true;
} else if (regionHeight >= 10 && context.dragDirection == Dygraph.VERTICAL) {
g.doZoomY_(Math.min(context.dragStartY, context.dragEndY),
Math.max(context.dragStartY, context.dragEndY));
+ context.cancelNextDblclick = true;
} else {
g.clearZoomRect_();
}
// Disable zooming out if panning.
dblclick: function(event, g, context) {
+ if (context.cancelNextDblclick) {
+ context.cancelNextDblclick = false;
+ return;
+ }
if (event.altKey || event.shiftKey) {
return;
}
var dygraph = this;
this.mouseMoveHandler = function(e) {
- dygraph.mouseMove_(e);
+ dygraph.mouseMove_(e);
};
Dygraph.addEvent(this.mouseEventElement_, 'mousemove', this.mouseMoveHandler);
this.mouseOutHandler = function(e) {
- dygraph.mouseOut_(e);
+ dygraph.mouseOut_(e);
};
Dygraph.addEvent(this.mouseEventElement_, 'mouseout', this.mouseOutHandler);
prevEndX: null, // pixel coordinates
prevEndY: null, // pixel coordinates
prevDragDirection: null,
+ cancelNextDblclick: false, // see comment in dygraph-interaction-model.js
// The value on the left side of the graph when a pan operation starts.
initialLeftmostDate: null,
context.py = Dygraph.findPosY(g.canvas_);
context.dragStartX = g.dragGetX_(event, context);
context.dragStartY = g.dragGetY_(event, context);
+ context.cancelNextDblclick = false;
}
};