MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 84: | Line 84: | ||
var mouseY=0; | var mouseY=0; | ||
/* 각주 팝업창 위치 보정 DOM */ | /* 각주 팝업창 위치 보정 DOM */ | ||
var observer = new MutationObserver(function (mutationList) { | |||
mutationList.forEach(function (mutation) { | |||
mutation.addedNodes.forEach(function (node) { | |||
if (node.classList && node.classList.contains('mwe-popups')) { | |||
requestAnimationFrame(function () { | |||
var bodyLeft = document.body.getBoundingClientRect().left; | |||
var left = parseInt(window.getComputedStyle(node).left); | |||
node.style.left = left - bodyLeft + 'px'; | |||
}); | |||
} | |||
}); | |||
}); | |||
}); | |||
// 감시할 대상 설정 | |||
observer.observe(document.body, { | |||
childList: true, | |||
subtree: true, | |||
}); | |||
} | |||
}, | |||
); | |||
/* 우클릭 방지 */ | /* 우클릭 방지 */ | ||