1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-19 06:06:54 +00:00

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
2 changed files with 4 additions and 6 deletions

View File

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

View File

@@ -15,11 +15,6 @@ export class TocDesktop {
} }
static init() { static init() {
const $tocWrapper = document.getElementById('toc-wrapper'); tocbot.init(this.options);
if ($tocWrapper) {
tocbot.init(this.options);
$tocWrapper.classList.remove('invisible');
}
} }
} }