MediaWiki:Common.js: diferenças entre revisões
Sem resumo de edição |
Sem resumo de edição |
||
| Linha 85: | Linha 85: | ||
} | } | ||
/* 각주 팝업창 위치 보정 */ | var mouseX=0; | ||
var mouseY=0; | |||
/* 각주 팝업창 위치 보정 DOM */ | |||
var observer = new MutationObserver(function (mutationList) { | |||
mutationList.forEach(function (mutation) { | |||
mutation.addedNodes.forEach(function (node) { | |||
if (node.classList && (node.classList.contains('mwe-popups')|| node.classList.contains('rt-tooltip'))) { | |||
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, | |||
}); | |||
/* 우클릭 방지 */ | /* 우클릭 방지 */ | ||