diff --git a/_javascript/modules/components/toc.js b/_javascript/modules/components/toc.js index e9086ee..dec814f 100644 --- a/_javascript/modules/components/toc.js +++ b/_javascript/modules/components/toc.js @@ -27,6 +27,9 @@ function init() { mobile.init(); } + const $tocWrapper = document.getElementById('toc-wrapper'); + $tocWrapper.classList.remove('invisible'); + desktopMode.onchange = refresh; } diff --git a/_javascript/modules/components/toc/toc-desktop.js b/_javascript/modules/components/toc/toc-desktop.js index 0aaba48..ea4986b 100644 --- a/_javascript/modules/components/toc/toc-desktop.js +++ b/_javascript/modules/components/toc/toc-desktop.js @@ -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); } }