| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,6 +187,20 @@ | |||
| 187 | 187 | }); | |
| 188 | 188 | } | |
| 189 | 189 | ||
| 190 | + function setupSidebarScroll() { | ||
| 191 | + const sidebarLinks = document.querySelectorAll('#column2 a'); | ||
| 192 | + | ||
| 193 | + let link; | ||
| 194 | + for (link of sidebarLinks) { | ||
| 195 | + if (link.pathname === window.location.pathname) break; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + if (!link) return; | ||
| 199 | + | ||
| 200 | + link.scrollIntoView({ block: 'center' }); | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + | ||
| 190 | 204 | function bootstrap() { | |
| 191 | 205 | // Check if we have JavaScript support. | |
| 192 | 206 | document.documentElement.classList.add('has-js'); | |
@@ -206,6 +220,8 @@ | |||
| 206 | 220 | setupFlavorToggles(); | |
| 207 | 221 | ||
| 208 | 222 | setupCopyButton(); | |
| 223 | + | ||
| 224 | + setupSidebarScroll(); | ||
| 209 | 225 | } | |
| 210 | 226 | ||
| 211 | 227 | if (document.readyState === 'loading') { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments