미디어위키:Common.js: 두 판 사이의 차이
Resultofunion (토론 | 기여) 편집 요약 없음 |
Resultofunion (토론 | 기여) 편집 요약 없음 |
||
| 94번째 줄: | 94번째 줄: | ||
/* 각주 팝업창 위치 보정 */ | /* 각주 팝업창 위치 보정 */ | ||
// MutationObserver를 사용하여 DOM 변경 사항 감지 | |||
var observer = new MutationObserver(function (mutationList){ | var observer = new MutationObserver(function (mutationList){ | ||
mutationList.forEach(function(mutation){ | mutationList.forEach(function(mutation){ | ||
mutation.addedNodes.forEach(function (node) { | mutation.addedNodes.forEach(function (node) { | ||
if (node.classList && node.classList.contains('mwe-popups')) { | if (node.classList && node.classList.contains('mwe-popups')) { | ||
| 109번째 줄: | 108번째 줄: | ||
}) | }) | ||
}) | }) | ||
// 감시할 대상 설정 | |||
observer.observe(document.body, { | observer.observe(document.body, { | ||
childList:true, | childList:true, | ||