MediaWiki:Common.js: Difference between revisions
No edit summary Tag: Manual revert |
No edit summary |
||
| Line 68: | Line 68: | ||
if (e.target.classList && e.target.classList.contains('rt-tooltip')) { | if (e.target.classList && e.target.classList.contains('rt-tooltip')) { | ||
requestAnimationFrame(function () { | requestAnimationFrame(function () { | ||
var bodyTop = document.body.getBoundingClientRect().top; | |||
var top = parseInt(window.getComputedStyle(e.target).top); | |||
var bodyLeft = document.body.getBoundingClientRect().left; | var bodyLeft = document.body.getBoundingClientRect().left; | ||
var left = parseInt(window.getComputedStyle(e.target).left); | var left = parseInt(window.getComputedStyle(e.target).left); | ||
| Line 73: | Line 76: | ||
console.log(left - bodyLeft); | console.log(left - bodyLeft); | ||
e.target.style.left = left - bodyLeft + 'px'; | e.target.style.left = left - bodyLeft + 'px'; | ||
e.target.style.top = top - bodyTop + 'px'; | |||
console.log(e.target); | console.log(e.target); | ||