Skip to content

Commit

Permalink
Update line-customTooltips.html
Browse files Browse the repository at this point in the history
Add window scroll position to tooltip position calculation so they show up in the intended place instead of potentially off-screen!
  • Loading branch information
el-ee authored Mar 16, 2017
1 parent 1ca0ffb commit d851295
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/tooltips/line-customTooltips.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@

// Display, position, and set styles for font
tooltipEl.style.opacity = 1;
tooltipEl.style.left = position.left + tooltip.caretX + 'px';
tooltipEl.style.top = position.top + tooltip.caretY + 'px';
tooltipEl.style.left = position.left + tooltip.caretX + window.pageXOffset + 'px';
tooltipEl.style.top = position.top + tooltip.caretY + window.pageYOffset + 'px';
tooltipEl.style.fontFamily = tooltip._fontFamily;
tooltipEl.style.fontSize = tooltip.fontSize;
tooltipEl.style.fontStyle = tooltip._fontStyle;
Expand Down

0 comments on commit d851295

Please sign in to comment.