diff --git a/NEWS.md b/NEWS.md index 4e55803..b4c70ed 100644 --- a/NEWS.md +++ b/NEWS.md @@ -170,6 +170,9 @@ The base and overlay canvas are now using the CSS classes "flot-base" and - Avoided floating-point precision errors when calculating pie percentages. (patch by James Ward, pull request #918) + - Fixed compatibility with jQuery 1.2.6, which has no 'mouseleave' shortcut. + (reported by Bevan, original pull request #920, replaced by direct patch) + ## Flot 0.7 ## diff --git a/jquery.flot.js b/jquery.flot.js index 605fce8..650a215 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -884,7 +884,14 @@ Licensed under the MIT license. // bind events if (options.grid.hoverable) { eventHolder.mousemove(onMouseMove); - eventHolder.mouseleave(onMouseLeave); + + // Use bind, rather than .mouseleave, because we officially + // still support jQuery 1.2.6, which doesn't define a shortcut + // for mouseenter or mouseleave. This was a bug/oversight that + // was fixed somewhere around 1.3.x. We can return to using + // .mouseleave when we drop support for 1.2.6. + + eventHolder.bind("mouseleave", onMouseLeave); } if (options.grid.clickable)