BookStack/resources/assets/js/components/sidebar.js
2017-08-27 15:16:51 +01:00

16 lines
No EOL
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;