From 7796d9b7d589ecf12f339246e95e25eb0fb79a33 Mon Sep 17 00:00:00 2001 From: COMTREE Date: Tue, 16 Sep 2025 14:08:04 +0900 Subject: [PATCH] fix: improve category cancel button functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Enhanced resetCategoryForm() to properly reset editing state - Clear currentEditCategoryId when cancelling - Reset button text and form title to default state - Add console logging for better debugging 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- admin/script.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/admin/script.js b/admin/script.js index 4c9efd4..bb5cbf5 100644 --- a/admin/script.js +++ b/admin/script.js @@ -1367,6 +1367,22 @@ class AdminFileManager { resetCategoryForm() { document.getElementById('categoryName').value = ''; + this.currentEditCategoryId = null; + + // 버튼 텍스트를 기본 상태로 복원 + const submitBtn = document.getElementById('addCategoryBtn'); + if (submitBtn) { + submitBtn.textContent = '➕ 카테고리 추가'; + submitBtn.disabled = false; + } + + // 폼 제목을 기본 상태로 복원 + const formTitle = document.querySelector('#categoryTab h2'); + if (formTitle) { + formTitle.textContent = '🏷️ 카테고리 관리'; + } + + console.log('카테고리 폼이 초기화되었습니다.'); } renderCategoryList() {