MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 86: | Line 86: | ||
if (e.target.classList && e.target.classList.contains('mwe-popups')){ | if (e.target.classList && e.target.classList.contains('mwe-popups')){ | ||
requestAnimationFrame(function () { | requestAnimationFrame(function () { | ||
var $link = document.querySelector('.mw-parser-output a'); | |||
var linkTop = $link.BoundingClientRect().top + window.scrollY; | |||
var bodyTop = document.body.getBoundingClientRect().top + window.scrollY; | |||
var top = parseInt(window.getComputedStyle(e.target).top); | |||
var bodyLeft = document.body.getBoundingClientRect().left; | |||
var left = parseInt(window.getComputedStyle(e.target).left); | |||
e.target.style.left = left - bodyLeft + 'px'; | |||
e.target.style.top = linkTop - e.target.offsetHeight - 5 + 'px'; | |||
console.log('^^'); | console.log('^^'); | ||
}); | }); | ||