From a944592ed1451af48dd88be8a5ec8001462d2865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=84=B1=EC=98=81?= Date: Tue, 9 Sep 2025 10:56:08 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B6=88=EB=B2=95=ED=96=89=EC=9C=84=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=82=AC=EC=A7=84=20=EC=97=85=EB=A1=9C=EB=93=9C,?= =?UTF-8?q?=20=EB=93=9C=EB=9E=98=EA=B7=B8=EC=9D=B8=20=EB=93=9C=EB=A1=AD=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crdnActInfo/crdnActInfoRegistPopup.jsp | 29 ++++++++++++++++++- .../webapp/resources/xit/xit-fileupload.css | 6 ++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/views/crdn/crndRegistAndView/crdnActInfo/crdnActInfoRegistPopup.jsp b/src/main/webapp/WEB-INF/views/crdn/crndRegistAndView/crdnActInfo/crdnActInfoRegistPopup.jsp index 476fbc9..5a32b42 100644 --- a/src/main/webapp/WEB-INF/views/crdn/crndRegistAndView/crdnActInfo/crdnActInfoRegistPopup.jsp +++ b/src/main/webapp/WEB-INF/views/crdn/crndRegistAndView/crdnActInfo/crdnActInfoRegistPopup.jsp @@ -495,13 +495,40 @@ /** * 파일 업로드 초기화 - * 중요한 로직 주석: 파일 선택 이벤트와 파일 유효성 검증을 초기화한다. + * 중요한 로직 주석: 파일 선택 이벤트와 드래그앤드롭 이벤트를 추가하고 파일 유효성 검증을 초기화한다. */ function initFileUpload() { + var dropZone = $('#photoPreviewContainer'); + // 파일 선택 이벤트 $('#photoFiles').on('change', function(e) { handleFileSelect(e.target.files); }); + + // 중요로직: 드래그앤드롭으로 파일 업로드 처리 + dropZone.on('dragover', function(e) { + e.preventDefault(); + e.stopPropagation(); + dropZone.addClass('drag-over'); + }); + + dropZone.on('dragleave', function(e) { + e.preventDefault(); + e.stopPropagation(); + dropZone.removeClass('drag-over'); + }); + + dropZone.on('drop', function(e) { + e.preventDefault(); + e.stopPropagation(); + dropZone.removeClass('drag-over'); + + var files = e.originalEvent.dataTransfer.files; + if (files.length > 0) { + // 기존 파일 선택 로직 재사용 + handleFileSelect(files); + } + }); } /** diff --git a/src/main/webapp/resources/xit/xit-fileupload.css b/src/main/webapp/resources/xit/xit-fileupload.css index 13268c4..d5aaca9 100644 --- a/src/main/webapp/resources/xit/xit-fileupload.css +++ b/src/main/webapp/resources/xit/xit-fileupload.css @@ -8,6 +8,12 @@ margin-top: 10px; } +/* 드래그앤드롭 영역 스타일 */ +.photo-preview-container.drag-over { + border: 2px dashed #007bff; + background-color: #f8f9fa; +} + /* 파일 업로드 컨트롤 영역 */ .file-upload-controls { display: flex;