summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sfiligoi <isfiligoi@ucsd.edu>2009-06-23 00:31:16 +0000
committerIgor Sfiligoi <isfiligoi@ucsd.edu>2009-06-23 00:31:16 +0000
commita328ad82d8d883b9dfaf41dc2b720828dde3bb0f (patch)
treecd7bcb0807a05e51342e9af62dcb1d0d360614e2
parentf021b6e94bbae695da4116c0f972bac8705c8c20 (diff)
Fix bug in selection - now properly unbind before rebinding
-rw-r--r--src/lib/rrdFlot.js4
1 files changed, 3 insertions, 1 deletions
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);
});