12 lines
319 B
JavaScript
12 lines
319 B
JavaScript
|
const toggleToc = (() => {
|
||
|
let tocToggle = document.getElementById('js-toc-toggle');
|
||
|
let tocContents = document.getElementById('js-toc-contents');
|
||
|
|
||
|
if (tocToggle) {
|
||
|
tocToggle.addEventListener('click', () => {
|
||
|
tocContents.classList.toggle('toc-contents--active');
|
||
|
});
|
||
|
}
|
||
|
})();
|
||
|
|
||
|
export { toggleToc };
|