fix: 상단 버튼 안되는 버그 수정
This commit is contained in:
@@ -21,18 +21,13 @@ htmlReady(() => {
|
|||||||
for(const openWindowBtn of document.querySelectorAll('.open-window')){
|
for(const openWindowBtn of document.querySelectorAll('.open-window')){
|
||||||
openWindowBtn.addEventListener('click', function (e) {
|
openWindowBtn.addEventListener('click', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
console.log(e);
|
||||||
let target: HTMLElement | null = e.target as HTMLElement;
|
let target: HTMLElement | null = e.target as HTMLElement;
|
||||||
while (target !== null) {
|
while (target !== null) {
|
||||||
target = target.parentElement;
|
if(target.tagName != 'a' && (target as HTMLAnchorElement).href){
|
||||||
if (target === null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (target.tagName != 'a') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((target as HTMLAnchorElement).href !== undefined) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
target = target.parentElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
|
|||||||
Reference in New Issue
Block a user