1
0
mirror of https://github.com/mbirth/tcl_update_db.git synced 2024-12-26 04:24:07 +00:00

Fix tooltip position when text too wide.

This commit is contained in:
Markus Birth 2018-06-20 19:08:49 +02:00
parent 4c247369d0
commit 3707089942

View File

@ -114,7 +114,10 @@ document.addEventListener 'DOMContentLoaded', (event) ->
if mouseX + cursorOffset + tooltipWidth >= viewportRight
# show tooltip LEFT of cursor
tooltip.style.left = (mouseX - cursorOffset - tooltipWidth) + 'px'
leftPos = mouseX - cursorOffset - tooltipWidth
if leftPos < 0
leftPos = 0
tooltip.style.left = leftPos + 'px'
else
# show tooltip right of cursor
tooltip.style.left = (mouseX + cursorOffset) + 'px'