mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
16 lines
320 B
JavaScript
16 lines
320 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');
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = Sidebar; |