ux(dashboard): remember details open state via storage-key

This commit is contained in:
萝卜
2026-03-17 07:57:20 +08:00
parent b2d5101d77
commit 65323280d2
2 changed files with 4 additions and 3 deletions

View File

@@ -92,7 +92,8 @@
// 通用折叠面板collapsible记忆展开状态localStorage
// 用法:<details data-role="collapsible" data-storage-key="xxx">
(function () {
var nodes = document.querySelectorAll('details[data-role="collapsible"][data-storage-key]');
// 兼容历史:旧实现要求 data-role="collapsible";现在只要存在 data-storage-key 就启用记忆。
var nodes = document.querySelectorAll('details[data-storage-key], details[data-role="collapsible"][data-storage-key]');
if (!nodes || nodes.length === 0) {
return;
}