From 932e8ca093dc3390e2ad56cd475f7cf96a7c9852 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 11 Dec 2021 14:05:06 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=83=81=EB=8B=A8=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=20=EC=95=88=EB=90=98=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/legacy/main.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hwe/ts/legacy/main.ts b/hwe/ts/legacy/main.ts index 1a20eb23..c681ac97 100644 --- a/hwe/ts/legacy/main.ts +++ b/hwe/ts/legacy/main.ts @@ -21,18 +21,13 @@ htmlReady(() => { for(const openWindowBtn of document.querySelectorAll('.open-window')){ openWindowBtn.addEventListener('click', function (e) { e.preventDefault(); + console.log(e); let target: HTMLElement | null = e.target as HTMLElement; while (target !== null) { - target = target.parentElement; - if (target === null) { - return; - } - if (target.tagName != 'a') { - continue; - } - if ((target as HTMLAnchorElement).href !== undefined) { + if(target.tagName != 'a' && (target as HTMLAnchorElement).href){ break; } + target = target.parentElement; } if (!target) {