fix: js err

This commit is contained in:
Cory Dransfeldt 2024-08-29 11:29:29 -07:00
parent f101d122c0
commit 0967da50f7
No known key found for this signature in database
3 changed files with 6 additions and 3 deletions

View file

@ -48,9 +48,12 @@ window.addEventListener('load', () => {
const minHeight = 500 // this needs to match the height set on [data-toggle-content].text-toggle-hidden in text-toggle.css
const interiorHeight = Array.from(text).reduce((acc, node) => acc + node.scrollHeight, 0)
if (!button || !content || !text) return
if (interiorHeight < minHeight) {
content.classList.remove('text-toggle-hidden')
button.style.display = 'none'
return
}
button.addEventListener('click', () => {