fix: 메인페이지 갱신 버튼이 일부만 동작하는 버그
This commit is contained in:
+27
-23
@@ -11,33 +11,37 @@ exportWindow(jQuery, '$');
|
|||||||
|
|
||||||
|
|
||||||
htmlReady(() => {
|
htmlReady(() => {
|
||||||
document.querySelector('.refreshPage')?.addEventListener('click', function () {
|
for(const refreshBtn of document.querySelectorAll('.refreshPage')){
|
||||||
document.location.reload();
|
refreshBtn.addEventListener('click', function () {
|
||||||
return false;
|
document.location.reload();
|
||||||
});
|
return false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
document.querySelector('.open-window')?.addEventListener('click', function (e) {
|
for(const openWindowBtn of document.querySelectorAll('.open-window')){
|
||||||
e.preventDefault();
|
openWindowBtn.addEventListener('click', function (e) {
|
||||||
let target: HTMLElement | null = e.target as HTMLElement;
|
e.preventDefault();
|
||||||
while (target !== null) {
|
let target: HTMLElement | null = e.target as HTMLElement;
|
||||||
target = target.parentElement;
|
while (target !== null) {
|
||||||
if (target === null) {
|
target = target.parentElement;
|
||||||
|
if (target === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (target.tagName != 'a') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ((target as HTMLAnchorElement).href !== undefined) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!target) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (target.tagName != 'a') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((target as HTMLAnchorElement).href !== undefined) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!target) {
|
window.open((target as HTMLAnchorElement).href);
|
||||||
return;
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.open((target as HTMLAnchorElement).href);
|
|
||||||
});
|
|
||||||
|
|
||||||
activateFlip();
|
activateFlip();
|
||||||
initTooltip();
|
initTooltip();
|
||||||
|
|||||||
Reference in New Issue
Block a user