Browse Source

addresses #1273 - stops hover items straying off-screen

tags/v0.4^2
James 4 years ago
parent
commit
56a98352c5
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      src/client/ui/templates/tooltipItem/tooltipItem.js

+ 9
- 0
src/client/ui/templates/tooltipItem/tooltipItem.js View File

@@ -472,6 +472,15 @@ define([
if (bottomAlign)
pos.y -= this.tooltip.height();

//correct tooltips that are appearing offscreen
//arbitrary constant -30 is there to stop resize code
//completely squishing the popup
if ( (pos.x+this.tooltip.width() ) > window.innerWidth)
pos.x = window.innerWidth - this.tooltip.width()-30;

if( (pos.y+this.tooltip.height() ) > window.innerHeight)
pos.y = window.innerHeight - this.tooltip.height()-30;

this.tooltip.css({
left: pos.x,
top: pos.y


Loading…
Cancel
Save