MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 66: | Line 66: | ||
function (e) { | function (e) { | ||
if (e.target.classList && e.target.classList.contains('rt-tooltip')) { | if (e.target.classList && e.target.classList.contains('rt-tooltip')) { | ||
requestAnimationFrame(function () { | |||
var bodyLeft = document.body.getBoundingClientRect().left; | |||
var left = parseInt(window.getComputedStyle(e.target).left); | |||
e.target.style.left = left - bodyLeft + 'px'; | |||
}); | |||
} | |||
}, | |||
false | |||
); | |||
document.body.addEventListener( | |||
'DOMNodeInserted', | |||
function (e) { | |||
if (e.target.classList && e.target.classList.contains('mwe-popups')) { | |||
requestAnimationFrame(function () { | requestAnimationFrame(function () { | ||
var bodyLeft = document.body.getBoundingClientRect().left; | var bodyLeft = document.body.getBoundingClientRect().left; | ||