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) { 대량문자(광고문자) - +