From d3ee183efcfcc7b31486a0bfe32b8e44ae4a6de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 14 Mar 2026 16:05:19 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[demo]=20closeModal=20=EB=93=B1=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=EB=A5=BC=20window=20=EC=8A=A4=EC=BD=94?= =?UTF-8?q?=ED=94=84=EC=97=90=20=EB=AA=85=EC=8B=9C=EC=A0=81=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/sales/demo-tenants/index.blade.php | 13 ++++++------- .../demo-tenants/partials/show-modal.blade.php | 12 ++++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/resources/views/sales/demo-tenants/index.blade.php b/resources/views/sales/demo-tenants/index.blade.php index bc1c9dbb..9957d732 100644 --- a/resources/views/sales/demo-tenants/index.blade.php +++ b/resources/views/sales/demo-tenants/index.blade.php @@ -95,24 +95,23 @@ class="refresh-btn inline-flex items-center gap-1.5 px-3 py-2 text-sm text-gray- if (msg) showToast(msg); }); -function showDetailModal(id) { - const modal = document.getElementById('modal-container'); +window.showDetailModal = function(id) { htmx.ajax('GET', `/sales/demo-tenants/${id}`, {target: '#modal-container', swap: 'innerHTML'}); -} +}; -function closeModal() { +window.closeModal = function() { document.getElementById('modal-container').innerHTML = ''; document.body.style.overflow = ''; -} +}; -function showToast(message, type) { +window.showToast = function(message, type) { const toast = document.createElement('div'); const isError = type === 'error'; toast.className = `fixed top-4 right-4 z-[100] px-4 py-3 rounded-lg shadow-lg text-white text-sm font-medium transition-all transform ${isError ? 'bg-red-600' : 'bg-emerald-600'}`; toast.textContent = message; document.body.appendChild(toast); setTimeout(() => { toast.style.opacity = '0'; setTimeout(() => toast.remove(), 300); }, 3000); -} +}; // HX-Trigger 이벤트 파싱 document.body.addEventListener('htmx:afterRequest', function(e) { diff --git a/resources/views/sales/demo-tenants/partials/show-modal.blade.php b/resources/views/sales/demo-tenants/partials/show-modal.blade.php index 9549a630..dc6f5efd 100644 --- a/resources/views/sales/demo-tenants/partials/show-modal.blade.php +++ b/resources/views/sales/demo-tenants/partials/show-modal.blade.php @@ -159,7 +159,7 @@ class="px-4 py-1.5 text-sm font-medium text-gray-600 hover:bg-gray-100 rounded-l