faheem801 / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

problem with plotunselected #430

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
i wanted to disable the tooltips while making a selection so i tried turning 
off the hoverable option in the plotselecting event and then turning it back on 
when i get a plotselected event. unfortunately when i unselect the selection 
hoverable is never turned back on because i get a plotselecting event after 
plotunselected (which is kind of weird). wouldn't it make more sense to get a 
plotselecting event first and then a plot unselected? this patch fixes the 
issue for me:

--- jquery.flot.selection.js    (revision 267)
+++ jquery.flot.selection.js    (working copy)
@@ -126,8 +126,8 @@
                 triggerSelectedEvent();
             else {
                 // this counts as a clear
+                plot.getPlaceholder().trigger("plotselecting", [ null ]);
                 plot.getPlaceholder().trigger("plotunselected", [ ]);
-                plot.getPlaceholder().trigger("plotselecting", [ null ]);
             }

             return false;

Original issue reported on code.google.com by aromo...@gmail.com on 22 Oct 2010 at 4:30

GoogleCodeExporter commented 9 years ago

Original comment by dnsch...@gmail.com on 4 Jun 2012 at 8:37

GoogleCodeExporter commented 9 years ago
The patch makes sense, but we need to think this through a little first.  Are 
there any cases where one would legitimately want to receive plotunselected 
first?  Do any of our core plugins depend on this behavior?

Original comment by dnsch...@gmail.com on 11 Jul 2012 at 1:10

GoogleCodeExporter commented 9 years ago
Hi,

We were able to reproduce the defect here and can see how the patch makes 
sense. We have a question though : Why is the "plotselecting" event triggered 
when we unselect a region? That line of code does not seem to have a side 
effect (as far as we checked). Also, none of the other plugins seem to be using 
that event. Does it make sense to get rid of that line entirely (and hence 
solving the hover-toggle issue)?

Original comment by vu2...@gmail.com on 14 Jul 2012 at 9:22

GoogleCodeExporter commented 9 years ago
indeed, i don't think the "plotselecting" event needs to be triggered when
we unselect the region. getting rid of the line entirely makes sense (and i
tested it with my program that it still works the way i excpect it). thanks.

--alex--

Original comment by aromo...@gmail.com on 14 Jul 2012 at 9:35