From 0e9ef6f2b21ccd39a329528e05e550d72803361b Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Thu, 22 Jan 2026 16:33:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A1=8C=E9=9D=A2?= =?UTF-8?q?=E7=AB=AF=E6=96=87=E7=AB=A0=E7=9B=AE=E5=BD=95=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 headIndex 插件中添加 defaultExpanded 选项支持 - 修改 current 方法,当 defaultExpanded 为 true 时不折叠其他子项 - 在 sidebar.php 中配置 defaultExpanded: true - 添加目录容器自动滚动功能,确保当前项保持在可视区域 - 添加独立的 window scroll 监听和 PJAX 后更新逻辑 --- assets/vendor/headindex/headindex.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/vendor/headindex/headindex.js b/assets/vendor/headindex/headindex.js index f534d99..1171811 100644 --- a/assets/vendor/headindex/headindex.js +++ b/assets/vendor/headindex/headindex.js @@ -143,6 +143,8 @@ indexItem.addClass(currentClass); + // 自动滚动目录容器,让当前项保持在可视区域 + if (this.mouseHovered) { return; }