feat:메뉴관리 전체 접기/펼치기 토글 버튼 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-14 14:52:09 +09:00
parent 04461e57f5
commit 7eb761af41
2 changed files with 36 additions and 0 deletions

View File

@@ -46,6 +46,24 @@ function hideChildren(parentId) {
});
}
// 전체 접기/펼치기
window.toggleAllChildren = function(collapse) {
const buttons = document.querySelectorAll('.toggle-btn');
buttons.forEach(btn => {
const menuId = btn.getAttribute('data-menu-id');
const chevron = btn.querySelector('.chevron-icon');
if (!chevron) return;
if (collapse) {
chevron.classList.add('rotate-[-90deg]');
hideChildren(menuId);
} else {
chevron.classList.remove('rotate-[-90deg]');
showChildren(menuId);
}
});
};
// 재귀적으로 직계 자식만 표시
function showChildren(parentId) {
const children = getChildElements(parentId);