mirror of
https://github.com/KingHWJ/WeReadBoard.git
synced 2026-11-03 18:24:58 +08:00
移除分类排序按钮,默认按分类排序展示
- 删除 index.html 中的 shelfSortBtn 按钮 - shelfSortMode 默认改为 category,始终按分类排序 - 删除 toggleShelfSort 函数和 .shelf-sort-btn CSS 样式 - 书架列表默认以分类分组渲染
This commit is contained in:
1 parent
e578a90543
commit
8b24052ab6
4 files changed
+44
-34
No files matched your search
@@ -447,31 +447,6 @@ body {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* 分类排序按钮 */
|
||||
.shelf-sort-btn {
|
||||
padding: 5px 14px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 20px;
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
background: var(--bg-card);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.shelf-sort-btn:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.shelf-sort-btn.active {
|
||||
border-color: var(--accent);
|
||||
color: #fff;
|
||||
background: var(--accent);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 分类分组标题 */
|
||||
.shelf-group-header {
|
||||
font-size: 15px;
|
||||
|
||||
+1
-8
@@ -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 () => {
|
||||
|
||||
Reference in new issue
Block a user