@knowcode/doc-builder 1.10.8 → 1.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/assets/js/main.js +19 -12
  2. package/package.json +1 -1
package/assets/js/main.js CHANGED
@@ -1090,22 +1090,29 @@ function initCollapsibleNavigation() {
1090
1090
 
1091
1091
  if (content) {
1092
1092
  const isExpanded = title.classList.contains('expanded');
1093
-
1093
+
1094
1094
  if (isExpanded) {
1095
1095
  // Collapse this section
1096
1096
  title.classList.remove('expanded');
1097
1097
  content.classList.add('collapsed');
1098
-
1099
- // Also collapse all child sections within this content
1100
- const childSections = content.querySelectorAll('.nav-title.collapsible');
1101
- childSections.forEach(childTitle => {
1102
- const childTargetId = childTitle.getAttribute('data-target');
1103
- const childContent = document.getElementById(childTargetId);
1104
- if (childContent) {
1105
- childTitle.classList.remove('expanded');
1106
- childContent.classList.add('collapsed');
1107
- }
1108
- });
1098
+
1099
+ // Recursively collapse ALL nested submenus
1100
+ const collapseAllNested = (parentContent) => {
1101
+ const childSections = parentContent.querySelectorAll('.nav-title.collapsible');
1102
+ childSections.forEach(childTitle => {
1103
+ const childTargetId = childTitle.getAttribute('data-target');
1104
+ const childContent = document.getElementById(childTargetId);
1105
+ if (childContent) {
1106
+ childTitle.classList.remove('expanded');
1107
+ childContent.classList.add('collapsed');
1108
+ // Recursively collapse any nested children
1109
+ collapseAllNested(childContent);
1110
+ }
1111
+ });
1112
+ };
1113
+
1114
+ // Collapse all nested content
1115
+ collapseAllNested(content);
1109
1116
  } else {
1110
1117
  // Expand this section
1111
1118
  title.classList.add('expanded');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.10.8",
3
+ "version": "1.10.9",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {