Skip to content

Commit f1fed79

Browse files
committed
docs: collapse MultitargetSRRegressor by default
1 parent 0c1bf69 commit f1fed79

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/src/.vitepress/theme/index.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,23 @@ export const Theme: ThemeConfig = {
2828
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
2929
})
3030
},
31-
enhanceApp({ app, router, siteData }) {
31+
enhanceApp({ app, router }) {
3232
enhanceAppWithTabs(app);
3333
app.component('VersionPicker', VersionPicker);
3434
app.component('AuthorBadge', AuthorBadge)
3535
app.component('Authors', Authors)
36+
37+
// Auto-collapse MultitargetSRRegressor documentation
38+
if (typeof window !== 'undefined') {
39+
router.onAfterRouteChange = () => {
40+
setTimeout(() => {
41+
const details = document.querySelector('details:has(a[id*="MultitargetSRRegressor"])')
42+
if (details?.hasAttribute('open')) {
43+
details.removeAttribute('open')
44+
}
45+
}, 100)
46+
}
47+
}
3648
}
3749
}
3850
export default Theme

0 commit comments

Comments
 (0)