From 86ea9a11d4d5da2a5260fbc2645b0dd58f46642c Mon Sep 17 00:00:00 2001 From: king Date: Sat, 17 Oct 2026 01:08:49 +0900 Subject: [PATCH] =?UTF-8?q?fix(erp-dialog):=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EC=95=88=EC=97=90=EC=84=9C=20=ED=99=95?= =?UTF-8?q?=EC=9D=B8=20=EC=B0=BD=EC=9D=B4=20=EB=92=A4=EC=97=90=20=EA=B9=94?= =?UTF-8?q?=EB=A0=A4=20=EC=95=88=20=EB=B3=B4=EC=9D=B4=EB=8D=98=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 입출고 옵션(상품 정보) ✕ 지우기 등 모달 (showModal) 안에서 erpConfirm 을 부르면 body 에 붙인 확인 창이 브라우저 맨 위 층 뒤에 깔려 보이지도 눌리지도 않았다. 모달이 열려 있을 때만 확인 창을 모달 껍데기로 감싸 그 위에 띄운다(Esc = 취소). 평소엔 예전 그대로. Co-Authored-By: Claude Opus 5.5 --- .../project/_meeting_content_base.html | 4 ++-- app/static/erp-dialog.css | 16 +++++++++++++++ app/static/erp-dialog.js | 20 ++++++++++++++++++- app/templates/erp_base.html | 4 ++-- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/app/modules/project/templates/project/_meeting_content_base.html b/app/modules/project/templates/project/_meeting_content_base.html index b56626d..87b96d0 100644 --- a/app/modules/project/templates/project/_meeting_content_base.html +++ b/app/modules/project/templates/project/_meeting_content_base.html @@ -6,7 +6,7 @@ {{ page_title or '주간 회의록' }} - + {% block head_extra %}{% endblock %} + diff --git a/app/static/erp-dialog.css b/app/static/erp-dialog.css index 5bdfb42..4b260ea 100644 --- a/app/static/erp-dialog.css +++ b/app/static/erp-dialog.css @@ -4,6 +4,22 @@ 없다. 화면 정중앙에 같은 모양으로 띄우기 위해 직접 그린다(erp-dialog.js). ════════════════════════════════════════════════════ */ +/* 모달 위에 띄울 때 감싸는 껍데기(erp-dialog.js) — 모양은 안쪽 .erp-dialog-backdrop 그대로, 껍데기는 보이지 않게 */ +.erp-dialog-host { + position: fixed; + inset: 0; + width: 100%; + height: 100%; + max-width: none; + max-height: none; + margin: 0; + padding: 0; + border: 0; + background: transparent; + overflow: visible; +} +.erp-dialog-host::backdrop { background: transparent; } + .erp-dialog-backdrop { position: fixed; inset: 0; diff --git a/app/static/erp-dialog.js b/app/static/erp-dialog.js index bebf855..ffd2a3b 100644 --- a/app/static/erp-dialog.js +++ b/app/static/erp-dialog.js @@ -116,11 +116,23 @@ var previous = document.activeElement; var closed = false; + // 모달 (showModal — 브라우저 맨 위 층)가 열려 있으면 body 에 붙인 창은 그 뒤에 깔려 안 보이고 눌리지도 않는다 + // (예: 입출고 옵션 팝업 안 [지우기] 확인). 그때만 이 창도 모달 로 감싸 그 위에 띄운다. 평소엔 예전 그대로. + var host = null; + try { + if (document.querySelector("dialog[open]:modal")) { + host = document.createElement("dialog"); + host.className = "erp-dialog-host"; + host.addEventListener("cancel", function (e) { e.preventDefault(); close(false); }); // Esc = 취소 + } + } catch (_) { host = null; } // :modal 을 모르는 아주 옛 브라우저 + function close(result) { if (closed) return; closed = true; document.removeEventListener("keydown", onKey, true); el.backdrop.remove(); + if (host) { if (host.open) host.close(); host.remove(); } if (previous && typeof previous.focus === "function") previous.focus(); // 입력창이면 확인 = 입력한 글자, 취소 = null if (el.input) resolve(result ? el.input.value : null); @@ -154,7 +166,13 @@ }); document.addEventListener("keydown", onKey, true); - document.body.appendChild(el.backdrop); + if (host) { + host.appendChild(el.backdrop); + document.body.appendChild(host); + host.showModal(); + } else { + document.body.appendChild(el.backdrop); + } if (el.input) { el.input.focus(); el.input.select(); } else el.ok.focus(); }); diff --git a/app/templates/erp_base.html b/app/templates/erp_base.html index 62c498d..57c23d8 100644 --- a/app/templates/erp_base.html +++ b/app/templates/erp_base.html @@ -7,7 +7,7 @@ - + {% block head_extra %}{% endblock %} @@ -189,7 +189,7 @@ {# 공용 확인/경고 창. defer 를 쓰지 않는다 — 아래 {% block scripts %} 의 인라인 스크립트가 곧바로 erpConfirm/erpAlert 을 쓸 수 있어야 한다. #} - + {# 긴급 공지 — 로그인한 모든 화면 가운데(받는 사람이 [확인] 전까지). app/modules/notice #} {% if user %}{% endif %}