feat: add organization schedule widget

This commit is contained in:
Matthieu Bessat 2020-07-05 14:36:10 +02:00
parent d8d53d184d
commit cdb197803c
3 changed files with 204 additions and 25 deletions

View file

@ -0,0 +1,19 @@
document.querySelectorAll('.schedule-category').forEach(node => {
let opened = false
let icon = node.querySelector('.schedule-category-collapse-icon')
let content = node.querySelector('.schedule-category-table')
let header = node.querySelector('.schedule-category-header')
header.onclick = () => {
if (!opened) {
// open the table
icon.style.transform = "rotate(180deg)"
content.style.maxHeight = content.scrollHeight + "px"
} else {
// close the table
icon.style.transform = "rotate(0deg)"
content.style.maxHeight = null
}
opened = !opened
}
})