/** * photo-modal.js — 사진 확대 모달 공통 모듈 * dashboard, management, inbox, issue-view 등에서 공유 */ function openPhotoModal(photoPath) { if (!photoPath) return; const modal = document.createElement('div'); modal.className = 'photo-modal-overlay'; modal.onclick = (e) => { if (e.target === modal) modal.remove(); }; modal.innerHTML = `
확대된 사진
`; document.body.appendChild(modal); // ESC 키로 닫기 const handleEsc = (e) => { if (e.key === 'Escape') { modal.remove(); document.removeEventListener('keydown', handleEsc); } }; document.addEventListener('keydown', handleEsc); } // 기존 코드 호환용 별칭 function showImageModal(imagePath) { openPhotoModal(imagePath); } function closePhotoModal() { const modal = document.querySelector('.photo-modal-overlay'); if (modal) modal.remove(); }