diff --git a/xian_favor/api.py b/xian_favor/api.py index e34f675..fcfe37d 100644 --- a/xian_favor/api.py +++ b/xian_favor/api.py @@ -3462,11 +3462,21 @@ function renderFolderList(type) { } // 切换文件夹区域展开/折叠 +// 切换文件夹区域展开/折叠,并过滤显示该类别数据 function toggleSection(type) { const section = document.getElementById(`section-${type}`); if (!section) return; + // 切换展开状态 section.classList.toggle('expanded'); + + // 更新侧边栏选中状态 + document.querySelectorAll('.sidebar a').forEach(a => a.classList.remove('active')); + section.querySelector('.section-header').classList.add('active'); + + // 设置过滤条件:只过滤类型,不限制文件夹 + currentFilter = { type, status: '', starred: null, folder_id: null }; + loadItems(1); } async function showNewFolderModal(type) {