hexo-theme-stellar/layout/_partial/scripts/sidebar.ejs

25 lines
573 B
Plaintext
Raw Permalink Normal View History

2024-02-12 23:07:56 +08:00
<script>
const sidebar = {
leftbar: () => {
if (l_body) {
l_body.toggleAttribute('leftbar');
l_body.removeAttribute('rightbar');
}
},
rightbar: () => {
if (l_body) {
l_body.toggleAttribute('rightbar');
l_body.removeAttribute('leftbar');
}
},
dismiss: () => {
if (l_body) {
l_body.removeAttribute('leftbar');
l_body.removeAttribute('rightbar');
}
},
toggleTOC: () => {
document.querySelector('#data-toc').classList.toggle('collapse');
}
}
</script>