Commit bcf9df2f authored by olau@iola.dk's avatar olau@iola.dk

Listen for mouseleave events and fire a plothover event with empty item when it occurs

git-svn-id: https://flot.googlecode.com/svn/trunk@281 1e0a6537-2640-0410-bfb7-f154510ff394
parent 53ba01ac
...@@ -103,11 +103,14 @@ Bug fixes: ...@@ -103,11 +103,14 @@ Bug fixes:
- Fix errors in JSON in examples so they work with jQuery 1.4.2 - Fix errors in JSON in examples so they work with jQuery 1.4.2
(fix reported by honestbleeps, issue 357). (fix reported by honestbleeps, issue 357).
- Fix bug with tooltip in interacting.html, this makes the tooltip - Fix bug with tooltip in interacting.html, this makes the tooltip
much smoother (fix by bdkahn). much smoother (fix by bdkahn). Fix related bug inside highlighting
handler in Flot.
- Use closure trick to make inline colorhelpers plugin respect - Use closure trick to make inline colorhelpers plugin respect
jQuery.noConflict(true), renaming the global jQuery object (reported jQuery.noConflict(true), renaming the global jQuery object (reported
by Nick Stielau). by Nick Stielau).
- Listen for mouseleave events and fire a plothover event with empty
item when it occurs to drop highlights when the mouse leaves the
plot (reported by by outspirit).
Flot 0.6 Flot 0.6
-------- --------
......
...@@ -740,8 +740,10 @@ ...@@ -740,8 +740,10 @@
eventHolder = $([overlay, canvas]); eventHolder = $([overlay, canvas]);
// bind events // bind events
if (options.grid.hoverable) if (options.grid.hoverable) {
eventHolder.mousemove(onMouseMove); eventHolder.mousemove(onMouseMove);
eventHolder.mouseleave(onMouseLeave);
}
if (options.grid.clickable) if (options.grid.clickable)
eventHolder.click(onClick); eventHolder.click(onClick);
...@@ -2271,6 +2273,12 @@ ...@@ -2271,6 +2273,12 @@
function (s) { return s["hoverable"] != false; }); function (s) { return s["hoverable"] != false; });
} }
function onMouseLeave(e) {
if (options.grid.hoverable)
triggerClickHoverEvent("plothover", e,
function (s) { return false; });
}
function onClick(e) { function onClick(e) {
triggerClickHoverEvent("plotclick", e, triggerClickHoverEvent("plotclick", e,
function (s) { return s["clickable"] != false; }); function (s) { return s["clickable"] != false; });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment