cfmgrv4 init...2

This commit is contained in:
최준흠 2024-10-12 12:45:36 +09:00
parent 39b87db614
commit d7e48a4ac8
4 changed files with 9 additions and 10 deletions

View File

@ -17,8 +17,6 @@
<tr> <tr>
<td colspan="<?= $cnt * 2 ?>" class="text-center"> <td colspan="<?= $cnt * 2 ?>" class="text-center">
<div><?= $viewDatas['message'] ?></div> <div><?= $viewDatas['message'] ?></div>
<p>작업 완료 아래 버튼을 클릭하면 모달이 닫힙니다.</p>
<button onclick="parent.closeBootstrapModal()">작업 완료</button>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -17,8 +17,6 @@
<tr> <tr>
<td colspan="<?= $cnt * 2 ?>" class="text-center"> <td colspan="<?= $cnt * 2 ?>" class="text-center">
<div><?= $viewDatas['message'] ?></div> <div><?= $viewDatas['message'] ?></div>
<p>작업 완료 아래 버튼을 클릭하면 모달이 닫힙니다.</p>
<button onclick="parent.closeBootstrapModal()">작업 완료</button>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -18,7 +18,8 @@
<!-- 여기에 동적으로 콘텐츠가 로드됩니다 --> <!-- 여기에 동적으로 콘텐츠가 로드됩니다 -->
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"
onClick="window.location.reload()">닫기</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -4,7 +4,8 @@
<!-- 동적으로 ifram src 바꾸고싶을때 <!-- 동적으로 ifram src 바꾸고싶을때
<span data-bs-toggle="modal" data-bs-target="#index_action_form" data-src="바꾸고싶은URL" style="cursor:pointer;">바꾸기</span> <span data-bs-toggle="modal" data-bs-target="#index_action_form" data-src="바꾸고싶은URL" style="cursor:pointer;">바꾸기</span>
--> -->
<div id="index_action_form" class="index_action_form modal fade" tabindex="-1" aria-labelledby="iframe_modal_label" aria-hidden="true"> <div id="index_action_form" class="index_action_form modal fade" tabindex="-1" aria-labelledby="iframe_modal_label"
aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable"> <!-- modal-lg는 모달 크기를 크게 설정 --> <div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable"> <!-- modal-lg는 모달 크기를 크게 설정 -->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -17,7 +18,8 @@
<iframe id="form-container" src="about:blank" width="100%" frameborder="0" allowfullscreen></iframe> <iframe id="form-container" src="about:blank" width="100%" frameborder="0" allowfullscreen></iframe>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"
onClick="window.location.reload()">Close</button>
</div> </div>
</div> </div>
</div> </div>
@ -42,13 +44,13 @@
} }
var index_action_form = document.getElementById('index_action_form'); var index_action_form = document.getElementById('index_action_form');
index_action_form.addEventListener('show.bs.modal', function(event) { index_action_form.addEventListener('show.bs.modal', function (event) {
var button = event.relatedTarget; var button = event.relatedTarget;
var iframeSrc = button.getAttribute('data-src'); var iframeSrc = button.getAttribute('data-src');
var iframe = document.getElementById('form-container'); var iframe = document.getElementById('form-container');
iframe.src = iframeSrc; iframe.src = iframeSrc;
// iframe이 로드된 후 높이를 조정하는 이벤트 리스너 추가 // iframe이 로드된 후 높이를 조정하는 이벤트 리스너 추가
iframe.onload = function() { iframe.onload = function () {
resizeIframe(); resizeIframe();
// 컨텐츠 변경 시 높이 재조정을 위한 MutationObserver 설정 // 컨텐츠 변경 시 높이 재조정을 위한 MutationObserver 설정
var iframeContent = iframe.contentDocument || iframe.contentWindow.document; var iframeContent = iframe.contentDocument || iframe.contentWindow.document;
@ -62,7 +64,7 @@
}); });
// 모달이 닫힐 때 iframe src를 초기화하여 종료 처리 // 모달이 닫힐 때 iframe src를 초기화하여 종료 처리
index_action_form.addEventListener('hidden.bs.modal', function() { index_action_form.addEventListener('hidden.bs.modal', function () {
var iframe = document.getElementById('form-container'); var iframe = document.getElementById('form-container');
iframe.src = "about:blank"; // 모달 닫힐 때 iframe 초기화 iframe.src = "about:blank"; // 모달 닫힐 때 iframe 초기화
}); });