--- src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp
... | ... | @@ -3195,21 +3195,53 @@ |
| 3195 | 3195 |
//fnLetterListAjax(); |
| 3196 | 3196 |
|
| 3197 | 3197 |
/* 윈도우팝업 열기 */ |
| 3198 |
-function infoPop(pageUrl){
|
|
| 3198 |
+/* 윈도우팝업 열기 */ |
|
| 3199 |
+var infoPopT; // 전역 변수로 선언하여 팝업 추적 |
|
| 3200 |
+ |
|
| 3201 |
+function infoPop(pageUrl) {
|
|
| 3202 |
+ // 기존 팝업이 존재하면 닫기 |
|
| 3203 |
+ if (infoPopT && !infoPopT.closed) {
|
|
| 3204 |
+ infoPopT.close(); |
|
| 3205 |
+ } |
|
| 3206 |
+ |
|
| 3207 |
+ // 기본값 설정 |
|
| 3208 |
+ let width = 790, height = 350; |
|
| 3209 |
+ |
|
| 3210 |
+ if (pageUrl === "adrvertisement1") {
|
|
| 3211 |
+ width = 790; |
|
| 3212 |
+ height = 800; |
|
| 3213 |
+ } else if (pageUrl === "selectMsgDataView3") {
|
|
| 3214 |
+ width = 500; |
|
| 3215 |
+ height = 550; |
|
| 3216 |
+ } |
|
| 3217 |
+ |
|
| 3218 |
+ // 🔥 현재 브라우저 창 크기 가져오기 |
|
| 3219 |
+ let screenWidth = window.innerWidth || document.documentElement.clientWidth || screen.width; |
|
| 3220 |
+ let screenHeight = window.innerHeight || document.documentElement.clientHeight || screen.height; |
|
| 3221 |
+ |
|
| 3222 |
+ // 💡 팝업을 브라우저 창 중앙에 위치시키기 위해 `top`, `left` 계산 |
|
| 3223 |
+ let left = (screenWidth - width) / 2 + window.screenX; |
|
| 3224 |
+ let top = (screenHeight - height) / 2 + window.screenY; |
|
| 3225 |
+ |
|
| 3226 |
+ // 📝 옵션 문자열 (정확한 중앙 정렬 적용) |
|
| 3227 |
+ let options = "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left + |
|
| 3228 |
+ ",fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbars=1"; |
|
| 3229 |
+ |
|
| 3230 |
+ console.log('팝업 옵션 : ', options);
|
|
| 3231 |
+ |
|
| 3232 |
+ // 🔥 window.open() 호출 |
|
| 3233 |
+ infoPopT = window.open("", 'infoPop', options);
|
|
| 3234 |
+ |
|
| 3235 |
+ // 🔄 폼 데이터 설정 및 제출 |
|
| 3199 | 3236 |
document.popForm.pageType.value = pageUrl; |
| 3200 | 3237 |
document.popForm.action = "/web/pop/infoPop.do"; |
| 3201 |
- document.popForm.method = "post"; |
|
| 3202 |
- if(pageUrl == "adrvertisement1"){
|
|
| 3203 |
- 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');
|
|
| 3204 |
- }else if(pageUrl == "selectMsgDataView3"){
|
|
| 3205 |
- 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');
|
|
| 3206 |
- }else{
|
|
| 3207 |
- 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');
|
|
| 3208 |
- } |
|
| 3209 |
- |
|
| 3238 |
+ document.popForm.method = "post"; |
|
| 3210 | 3239 |
document.popForm.target = "infoPop"; |
| 3211 | 3240 |
document.popForm.submit(); |
| 3212 | 3241 |
} |
| 3242 |
+ |
|
| 3243 |
+ |
|
| 3244 |
+ |
|
| 3213 | 3245 |
|
| 3214 | 3246 |
|
| 3215 | 3247 |
$(document).on('click', '.addressregi_btn', function() {
|
... | ... | @@ -3984,7 +4016,7 @@ |
| 3984 | 4016 |
</c:when> |
| 3985 | 4017 |
<c:otherwise> |
| 3986 | 4018 |
대량문자(광고문자) |
| 3987 |
- <button type="button" class="button info ad_btn" onclick="infoPop('adrvertisement1');" style="right: 128px;"><i></i>광고규정</button>
|
|
| 4019 |
+ <button type="button" class="button info ad_btn" onclick="infoPop('adrvertisement1');" style="right: 128px;"><i></i>광고규정</button>
|
|
| 3988 | 4020 |
</c:otherwise> |
| 3989 | 4021 |
</c:choose> |
| 3990 | 4022 |
</h2> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?