移除分类排序按钮,默认按分类排序展示

- 删除 index.html 中的 shelfSortBtn 按钮
- shelfSortMode 默认改为 category,始终按分类排序
- 删除 toggleShelfSort 函数和 .shelf-sort-btn CSS 样式
- 书架列表默认以分类分组渲染
This commit is contained in:
admin committed 2026-07-17 12:29:01 +08:00
1 parent e578a90543
commit 8b24052ab6
4 files changed
+44 -34

No files matched your search

+1 -8
View File
@@ -228,7 +228,7 @@ let shelfCategoryTree = {}; // { "历史": {count:114, subs:{"世界史":5,...
let shelfActiveCategory = ""; // 完整分类名,如 "历史-中国古代"
let shelfActiveParent = ""; // 父分类名,如 "历史";空表示"全部"
let shelfExpandedParents = new Set(); // 当前展开的父分类
let shelfSortMode = "default"; // "default" 或 "category"
let shelfSortMode = "category"; // 始终按分类排序,前端不显示切换按钮
async function loadShelfCategories() {
try {
@@ -318,13 +318,6 @@ function filterByCategory(fullCategory) {
loadShelf(1);
}
function toggleShelfSort() {
shelfSortMode = shelfSortMode === "category" ? "default" : "category";
const btn = document.getElementById("shelfSortBtn");
btn.classList.toggle("active", shelfSortMode === "category");
loadShelf(1);
}
// ===== 初始化 =====
document.addEventListener("DOMContentLoaded", async () => {