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

This commit is contained in:
Cotes Chung 2024-12-22 02:29:29 +08:00 committed by GitHub
parent c174f62f26
commit 32051dad03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View file

@ -27,6 +27,9 @@ function init() {
mobile.init();
}
const $tocWrapper = document.getElementById('toc-wrapper');
$tocWrapper.classList.remove('invisible');
desktopMode.onchange = refresh;
}

View file

@ -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');
}
}
}