Commit 91cad60
authored
Adjust TOC to support the same article linking from multiple locations (#653)
* feat: enhance navigation state management with session storage
- Updated the LeftNavTree component to support saving and retrieving navigation item IDs from session storage, improving user experience by maintaining state across sessions.
- Modified the calcExpandedIds function to accept an optional targetId for more precise matching.
- Implemented helper functions to handle session storage interactions for navigation items.
* refactor: simplify navigation state management in LeftNavTree component
- Removed session storage interactions for expanded and selected navigation items, streamlining state management.
- Updated the calcExpandedIds function calls to eliminate unnecessary parameters, enhancing clarity and performance.
* refactor: simplify scroll behavior in scrollToElementIfInView function
- Updated the scrollToElementIfInView function to directly call scrollIntoView with a "center" block option, removing unnecessary viewport checks and improving code clarity.1 parent c35718b commit 91cad60
File tree
2 files changed
+46
-13
lines changed- src
2 files changed
+46
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
| |||
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
93 | 123 | | |
94 | 124 | | |
95 | 125 | | |
| |||
110 | 140 | | |
111 | 141 | | |
112 | 142 | | |
113 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
114 | 149 | | |
115 | 150 | | |
116 | 151 | | |
| |||
191 | 226 | | |
192 | 227 | | |
193 | 228 | | |
194 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
195 | 236 | | |
196 | 237 | | |
197 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 292 | + | |
301 | 293 | | |
302 | 294 | | |
303 | 295 | | |
| |||
0 commit comments