Skip to content

Commit

Permalink
fix: toc not visible when switching from mobile to desktop mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Dec 21, 2024
1 parent c174f62 commit 80d1f3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions _javascript/modules/components/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function init() {
mobile.init();
}

const $tocWrapper = document.getElementById('toc-wrapper');
$tocWrapper.classList.remove('invisible');

desktopMode.onchange = refresh;
}

Expand Down
7 changes: 1 addition & 6 deletions _javascript/modules/components/toc/toc-desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 80d1f3a

Please sign in to comment.