1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2024-10-31 08:02:42 +01:00
BookStack/resources/assets/js/components/sidebar.js
2017-08-27 15:16:51 +01:00

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;