Skip to content

Commit

Permalink
Merge pull request #140 from trask/keep-tooltip-on-screen
Browse files Browse the repository at this point in the history
Keep tooltip on screen
  • Loading branch information
Kris Urbas authored Jul 26, 2016
2 parents 6217739 + bd419d8 commit dae90b2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions js/jquery.flot.tooltip.source.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
var totalTipHeight = $tip.outerHeight() + that.tooltipOptions.shifts.y;
if ((pos.x - $(window).scrollLeft()) > ($(window)[that.wfunc]() - totalTipWidth)) {
pos.x -= totalTipWidth;
pos.x = Math.max(pos.x, 0);
}
if ((pos.y - $(window).scrollTop()) > ($(window)[that.hfunc]() - totalTipHeight)) {
pos.y -= totalTipHeight;
Expand Down

0 comments on commit dae90b2

Please sign in to comment.