From 8d9704289c9e6fab5bb88fb6a8529c83e0973742 Mon Sep 17 00:00:00 2001 From: manufitoussi Date: Wed, 30 Jan 2013 10:58:45 +0100 Subject: [PATCH] Resize event causes several mouseUp handler to be be added. Prevent multiple registration. --- dygraph.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dygraph.js b/dygraph.js index 89e3c46..2580556 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1278,6 +1278,12 @@ Dygraph.prototype.createDragInterface_ = function() { bindHandler(interactionModel[eventName])); } + // unregister the handler on subsequent calls. + // This happens when the graph is resized. + if (this.mouseUpHandler_) { + Dygraph.removeEvent(document, 'mouseup', this.mouseUpHandler_); + }; + // If the user releases the mouse button during a drag, but not over the // canvas, then it doesn't count as a zooming action. this.mouseUpHandler_ = function(event) { -- 2.7.4