mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 07:32:39 +01:00
16 lines
318 B
JavaScript
16 lines
318 B
JavaScript
|
|
class Sidebar {
|
|
|
|
constructor(elem) {
|
|
this.elem = elem;
|
|
this.toggleElem = elem.querySelector('.sidebar-toggle');
|
|
this.toggleElem.addEventListener('click', this.toggle.bind(this));
|
|
}
|
|
|
|
toggle(show = true) {
|
|
this.elem.classList.toggle('open');
|
|
}
|
|
|
|
}
|
|
|
|
export default Sidebar; |