Skip to content

Commit 32051da

Browse files
authoredDec 21, 2024
fix: toc not visible when switching from mobile to desktop mode (#2139)
1 parent c174f62 commit 32051da

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
 

‎_javascript/modules/components/toc.js

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ function init() {
2727
mobile.init();
2828
}
2929

30+
const $tocWrapper = document.getElementById('toc-wrapper');
31+
$tocWrapper.classList.remove('invisible');
32+
3033
desktopMode.onchange = refresh;
3134
}
3235

‎_javascript/modules/components/toc/toc-desktop.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ export class TocDesktop {
1515
}
1616

1717
static init() {
18-
const $tocWrapper = document.getElementById('toc-wrapper');
19-
20-
if ($tocWrapper) {
21-
tocbot.init(this.options);
22-
$tocWrapper.classList.remove('invisible');
23-
}
18+
tocbot.init(this.options);
2419
}
2520
}

0 commit comments

Comments
 (0)