Fixed tooltips out of viewport (Y axis)

This commit is contained in:
Eduard Urbach 2019-08-31 00:20:15 +09:00
parent e8a9ae20c1
commit d8ae8dec82
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -39,6 +39,7 @@ export default class ToolTip extends HTMLElement {
}
let offsetX = 0
let offsetY = 0
if(finalX < contentRect.left) {
offsetX = contentRect.left - finalX
@ -48,6 +49,11 @@ export default class ToolTip extends HTMLElement {
finalX += offsetX
}
if(finalY < contentRect.top) {
offsetY = contentRect.top - finalY
finalY += offsetY
}
let arrowX = boxRect.width / 2 - offsetX
Diff.mutations.queue(() => {