feat: add organization schedule widget
This commit is contained in:
parent
d8d53d184d
commit
cdb197803c
3 changed files with 204 additions and 25 deletions
19
static/assets/js/organization.js
Normal file
19
static/assets/js/organization.js
Normal 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
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue