From cb5c65d611b10356b35f4a4b2d224763cb001954 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Thu, 22 Jan 2026 15:40:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DTODO=E5=9C=A8=E9=9D=9E?= =?UTF-8?q?=E5=81=9C=E9=9D=A0=E7=8A=B6=E6=80=81=E6=97=B6=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在所有关闭侧边栏的操作中添加折叠所有面板的逻辑 - 包括点击遮罩、关闭按钮、链接、搜索和目录跳转等场景 - 确保侧边栏关闭时所有折叠面板(TODO、文章目录等)都会自动收起 --- argontheme.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/argontheme.js b/argontheme.js index e89514d..dd03d45 100644 --- a/argontheme.js +++ b/argontheme.js @@ -2898,9 +2898,13 @@ $(document).on("click" , "#blog_categories .tag" , function(){ }); $(document).on("click" , "#sidebar_mask, #leftbar_close_btn" , function(){ $("html").removeClass("leftbar-opened"); + // 关闭侧边栏时折叠所有面板 + $(".leftbar-mobile-collapse-section.expanded").removeClass("expanded"); }); $(document).on("click" , "#leftbar a[href]:not([no-pjax]):not([href^='#']):not(.has-submenu)" , function(){ $("html").removeClass("leftbar-opened"); + // 关闭侧边栏时折叠所有面板 + $(".leftbar-mobile-collapse-section.expanded").removeClass("expanded"); }); // 移动端子菜单展开/收起 $(document).on("click" , ".leftbar-mobile-menu-item.has-children > a.has-submenu" , function(e){ @@ -2917,6 +2921,8 @@ $(document).on("click" , "#blog_categories .tag" , function(){ return; } $("html").removeClass("leftbar-opened"); + // 关闭侧边栏时折叠所有面板 + $(".leftbar-mobile-collapse-section.expanded").removeClass("expanded"); searchPosts(word); }); $(document).on("click" , "#navbar_global.show .navbar-nav a[href]:not([no-pjax]):not([href^='#'])" , function(){ @@ -3020,6 +3026,8 @@ $(document).on("click" , "#blog_categories .tag" , function(){ // 点击后关闭侧边栏 setTimeout(function() { $("html").removeClass("leftbar-opened"); + // 关闭侧边栏时折叠所有面板 + $(".leftbar-mobile-collapse-section.expanded").removeClass("expanded"); }, 150); } }