MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 61: | Line 61: | ||
} | } | ||
/* 각주 팝업창 위치 보정 | /* 각주 팝업창 위치 보정 DOM */ | ||
document.body.addEventListener( | document.body.addEventListener( | ||
' | 'NodeInserted', | ||
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 () { | requestAnimationFrame(function () { | ||
var bodyLeft = document.body.getBoundingClientRect().left; | var bodyLeft = document.body.getBoundingClientRect().left; | ||
| Line 73: | Line 71: | ||
var left = parseInt(window.getComputedStyle(e.target).left); | var left = parseInt(window.getComputedStyle(e.target).left); | ||
var top = parseInt(window.getComputedStyle(e.target).top); | var top = parseInt(window.getComputedStyle(e.target).top); | ||
e.target.style.left = mouseX + 'px'; | e.target.style.left = mouseX + 'px'; | ||
e.target.style.left = left - bodyLeft + 'px'; | |||
}); | }); | ||
} | } | ||