From 64c812167c6d1877acc9678757f54d226f5859bb Mon Sep 17 00:00:00 2001 From: jikwan0327 <102665117+jikwan0327@users.noreply.github.com> Date: Fri, 22 Sep 2023 21:56:10 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8C=9D=EC=97=85=20=EB=8B=AB=ED=9E=98?= =?UTF-8?q?=20=EC=8B=A4=ED=97=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/popup.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/apis/popup.tsx b/src/apis/popup.tsx index e885d00..8926e64 100644 --- a/src/apis/popup.tsx +++ b/src/apis/popup.tsx @@ -24,10 +24,18 @@ export const useOpenPopUp = () => { setToken(mdl_tknValue); - window.open( + const width = 500; + const height = 400; + const left = window.screenX + (window.outerWidth - width) / 2; + const top = window.screenY + (window.outerHeight - height) / 2; + var popup = window.open( `/pass?mdl_tkn=${mdl_tknValue}`, '_blank', - 'resizable=no,width=570,height=830,left=50,top=50', + `resizable=no,width=${width},height=${height},left=${left},top=${top}`, + ); + + window.addEventListener('beforeunload', () => + alert('팝업이 닫혔습니다'), ); }, },