fix default callout state

This commit is contained in:
Jacky Zhao
2023-07-04 18:26:11 -07:00
parent 7e901087d0
commit 70dcf6acc2
4 changed files with 7 additions and 10 deletions

View File

@ -1,7 +1,7 @@
function toggleCallout(this: HTMLElement) {
const outerBlock = this.parentElement!
this.classList.toggle(`is-collapsed`)
const collapsed = this.classList.contains(`is-collapsed`)
outerBlock.classList.toggle(`is-collapsed`)
const collapsed = outerBlock.classList.contains(`is-collapsed`)
const height = collapsed ? this.scrollHeight : outerBlock.scrollHeight
outerBlock.style.maxHeight = height + `px`
}