BookStack/resources/assets/js/components/sidebar.js

16 lines
318 B
JavaScript
Raw Normal View History

2017-08-27 22:16:51 +08:00
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;