0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-19 22:51:30 +00:00

Upgraded app to Laravel 5.7

This commit is contained in:
Dan Brown 2019-09-06 23:36:16 +01:00
parent 213e9d2941
commit 6917ea088f
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
179 changed files with 829 additions and 115 deletions
resources/js/components

View file

@ -0,0 +1,33 @@
import {slideUp, slideDown} from "../services/animations";
class ChapterToggle {
constructor(elem) {
this.elem = elem;
this.isOpen = elem.classList.contains('open');
elem.addEventListener('click', this.click.bind(this));
}
open() {
const list = this.elem.parentNode.querySelector('.inset-list');
this.elem.classList.add('open');
this.elem.setAttribute('aria-expanded', 'true');
slideDown(list, 240);
}
close() {
const list = this.elem.parentNode.querySelector('.inset-list');
this.elem.classList.remove('open');
this.elem.setAttribute('aria-expanded', 'false');
slideUp(list, 240);
}
click(event) {
event.preventDefault();
this.isOpen ? this.close() : this.open();
this.isOpen = !this.isOpen;
}
}
export default ChapterToggle;