From a328ad82d8d883b9dfaf41dc2b720828dde3bb0f Mon Sep 17 00:00:00 2001 From: Igor Sfiligoi Date: Tue, 23 Jun 2009 00:31:16 +0000 Subject: Fix bug in selection - now properly unbind before rebinding --- src/lib/rrdFlot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/rrdFlot.js b/src/lib/rrdFlot.js index cbb6ca8..f9d5ea3 100644 --- a/src/lib/rrdFlot.js +++ b/src/lib/rrdFlot.js @@ -338,6 +338,7 @@ rrdFlot.prototype.bindFlotGraph = function(flot_obj) { } // now connect the two + $(graph_jq_id).unbind("plotselected"); // but first remove old function $(graph_jq_id).bind("plotselected", function (event, ranges) { // do the zooming rf_this.selection_range.setFromFlotRanges(ranges); @@ -348,7 +349,8 @@ rrdFlot.prototype.bindFlotGraph = function(flot_obj) { // don't fire event on the scale to prevent eternal loop rf_this.scale.setSelection(ranges, true); }); - + + $(scale_jq_id).unbind("plotselected"); //same here $(scale_jq_id).bind("plotselected", function (event, ranges) { rf_this.graph.setSelection(ranges); }); -- cgit v1.2.3