feat:메뉴관리 전체 접기/펼치기 토글 버튼 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user