fix: toc not visible when switching from mobile to desktop mode (#2139)

This commit is contained in:
Cotes Chung authored and GitHub committed 2024-12-22 02:29:29 +08:00
1 parent c174f62f26
commit 32051dad03
2 files changed
+4 -6

No files matched your search

+3
View File
@@ -27,6 +27,9 @@ function init() {
mobile.init();
}
const $tocWrapper = document.getElementById('toc-wrapper');
$tocWrapper.classList.remove('invisible');
desktopMode.onchange = refresh;
}
@@ -15,11 +15,6 @@ export class TocDesktop {
}
static init() {
const $tocWrapper = document.getElementById('toc-wrapper');
if ($tocWrapper) {
tocbot.init(this.options);
$tocWrapper.classList.remove('invisible');
}
tocbot.init(this.options);
}
}