MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 68: | Line 68: | ||
requestAnimationFrame(function () { | requestAnimationFrame(function () { | ||
var bodyLeft = document.body.getBoundingClientRect().left; | var bodyLeft = document.body.getBoundingClientRect().left; | ||
var left = | const tooltipElement = document.getElementById('tooltip'); | ||
e.target.style.left = | |||
var left = Math.min(e.pageX, window.innerWidth - tooltipElement.offsetWidth); | |||
e.target.style.left = left + 'px'; | |||
e.target.style.top = e.pageY + 'px'; | e.target.style.top = e.pageY + 'px'; | ||
}); | }); | ||