Diferencia entre revisiones de «MediaWiki:Common.js»
Sin resumen de edición Etiqueta: Reversión manual |
Sin resumen de edición |
||
| Línea 55: | Línea 55: | ||
'DOMNodeInserted', | 'DOMNodeInserted', | ||
function (e) { | function (e) { | ||
if (e.target.classList && e.target.classList.contains(' | if (e.target.classList && e.target.classList.contains('rt-tooltip')) { | ||
requestAnimationFrame(function () { | requestAnimationFrame(function () { | ||
var linkId = e.target.id.substring(3); | |||
var $link = document.querySelector('#'+linkId); | |||
var linkTop = $link.getBoundingClientRect().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 bodyLeft = document.body.getBoundingClientRect().left; | ||
var left = parseInt(window.getComputedStyle(e.target).left); | var left = parseInt(window.getComputedStyle(e.target).left); | ||
e.target.style.left = left - bodyLeft + 'px'; | e.target.style.left = left - bodyLeft + 'px'; | ||
e.target.style.top = linkTop - e.target.offsetHeight - 5 + 'px'; | |||
}); | }); | ||
} | } | ||