diff --git a/public/themes/dist_static/static/css/category.css b/public/themes/dist_static/static/css/category.css index 89a4663..2708128 100644 --- a/public/themes/dist_static/static/css/category.css +++ b/public/themes/dist_static/static/css/category.css @@ -59,7 +59,6 @@ list-style: none; } .c-sidebar__item.is-active .c-sidebar__trigger { - padding: 2rem 0; color: var(--color-primary); } .c-sidebar__item.is-active .c-sidebar__subs { @@ -118,6 +117,9 @@ transform: rotate(-90deg); color: var(--color-primary); } +.c-sidebar__item.is-leaf .c-sidebar__trigger { + cursor: pointer; +} .c-sidebar__subs { display: none; margin: 0; diff --git a/public/themes/dist_static/static/js/category.js b/public/themes/dist_static/static/js/category.js index 6f4a23d..ce4872c 100644 --- a/public/themes/dist_static/static/js/category.js +++ b/public/themes/dist_static/static/js/category.js @@ -105,7 +105,8 @@ function bindEvents(state) { syncUrl(state); } else { const id = trigger.dataset.categoryId; - if (state.expandedId === id) state.expandedId = ""; + const isLeaf = !!trigger.closest(".c-sidebar__item.is-leaf"); + if (!isLeaf && state.expandedId === id) state.expandedId = ""; else { state.expandedId = id; state.categoryId = id; diff --git a/public/themes/website/1/zh/demo/category.html b/public/themes/website/1/zh/demo/category.html index 92bfffc..f23bf07 100644 --- a/public/themes/website/1/zh/demo/category.html +++ b/public/themes/website/1/zh/demo/category.html @@ -88,30 +88,40 @@ $current_cate_id = $current_cate['id'] ?? '';