2017-08-27 15:16:51 +01: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');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-11-09 21:17:35 +00:00
|
|
|
export default Sidebar;
|