philogb / jit

The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web
http://thejit.org
Other
1.51k stars 297 forks source link

Fix tooltips positions on pages with a scrollbar. #110

Closed ChALkeR closed 12 years ago

ChALkeR commented 12 years ago

Better viewport detection.

There are two bugs in current tooltips:

1) Incorrect tooltip positioning. Can be observed on pages with scrollbars. On http://thejit.org/static/v20/Jit/Examples/Icicle/example2.html: Horizontal placement is wrong (left instead of right): http://wstaw.org/m/2012/07/11/plasma-windowedEt2982.png Vertical placement is wrong (down instead of up): http://wstaw.org/m/2012/07/11/plasma-windowedlx2982.png Vertical placement is also wrong as horizontal in the first screenshot (up, when should be down) if body height is forced to 100% in css.

2) Incorrect tooltip widths: http://wstaw.org/m/2012/07/11/plasma-windowednt2982.png Not affected by this patch.

This patch fixes the first bug. After the patch is applied, the tooltip position is correct (bottom-right if possible in the current viewport).

ChALkeR commented 12 years ago

Whoops, there is an error on last line of the commit. Sorry.

ChALkeR commented 12 years ago

Fixed.