mirror of
https://github.com/mbirth/tcl_update_db.git
synced 2024-12-25 12:04:07 +00:00
Fix tooltip position when text too wide.
This commit is contained in:
parent
4c247369d0
commit
3707089942
@ -1,4 +1,4 @@
|
||||
document.addEventListener 'DOMContentLoaded', (event) ->
|
||||
document.addEventListener 'DOMContentLoaded', (event) ->
|
||||
|
||||
window.mdc.autoInit()
|
||||
window.tabBar = new mdc.tabs.MDCTabBar document.querySelector '#tab-bar'
|
||||
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user