fix: scripts

This commit is contained in:
Cory Dransfeldt 2024-08-29 09:48:35 -07:00
parent 55326dab7d
commit c108ea3732
No known key found for this signature in database
4 changed files with 11 additions and 27 deletions

View file

@ -48,8 +48,6 @@ 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'
@ -59,5 +57,5 @@ window.addEventListener('load', () => {
const isHidden = content.classList.toggle('text-toggle-hidden')
button.textContent = isHidden ? 'Show more' : 'Show less'
})
})
})()
})