From fc29e38eb671235d429398e23faea90ee8f2163e Mon Sep 17 00:00:00 2001 From: "hehihoho3@gmail.com" Date: Thu, 20 Feb 2025 18:23:50 +0900 Subject: [PATCH] =?UTF-8?q?=EC=95=88=EC=8B=AC=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EC=A4=91=EC=95=99=EC=A0=95=EB=A0=AC=20?= =?UTF-8?q?=EB=B0=8F=20=EA=B8=B0=EC=A1=B4=20=ED=81=AC=EA=B8=B0=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsp/web/msgdata/MsgDataSMLView.jsp | 54 +++++++++++++++---- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp b/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp index ee5a61f6..8283aceb 100644 --- a/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp @@ -3195,23 +3195,55 @@ function fnMyMsgAdd(msgId){ //fnLetterListAjax(); /* 윈도우팝업 열기 */ -function infoPop(pageUrl){ +/* 윈도우팝업 열기 */ +var infoPopT; // 전역 변수로 선언하여 팝업 추적 + +function infoPop(pageUrl) { + // 기존 팝업이 존재하면 닫기 + if (infoPopT && !infoPopT.closed) { + infoPopT.close(); + } + + // 기본값 설정 + let width = 790, height = 350; + + if (pageUrl === "adrvertisement1") { + width = 790; + height = 800; + } else if (pageUrl === "selectMsgDataView3") { + width = 500; + height = 550; + } + + // 🔥 현재 브라우저 창 크기 가져오기 + let screenWidth = window.innerWidth || document.documentElement.clientWidth || screen.width; + let screenHeight = window.innerHeight || document.documentElement.clientHeight || screen.height; + + // 💡 팝업을 브라우저 창 중앙에 위치시키기 위해 `top`, `left` 계산 + let left = (screenWidth - width) / 2 + window.screenX; + let top = (screenHeight - height) / 2 + window.screenY; + + // 📝 옵션 문자열 (정확한 중앙 정렬 적용) + let options = "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left + + ",fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbars=1"; + + console.log('팝업 옵션 : ', options); + + // 🔥 window.open() 호출 + infoPopT = window.open("", 'infoPop', options); + + // 🔄 폼 데이터 설정 및 제출 document.popForm.pageType.value = pageUrl; document.popForm.action = "/web/pop/infoPop.do"; - document.popForm.method = "post"; - if(pageUrl == "adrvertisement1"){ - window.open("about:blank", 'infoPop', 'width=790, height=800, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=1'); - }else if(pageUrl == "selectMsgDataView3"){ - window.open("about:blank", 'infoPop', 'width=500, height=550, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=1'); - }else{ - window.open("about:blank", 'infoPop', 'width=790, height=350, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=1'); - } - + document.popForm.method = "post"; document.popForm.target = "infoPop"; document.popForm.submit(); } + + + $(document).on('click', '.addressregi_btn', function() { var tableData = tableL.getRows(); var dataLen = tableL.getRows().length; @@ -3984,7 +4016,7 @@ function getMjMsgSentListAll(pageNo) { 대량문자(광고문자) - +