fix: scripts
This commit is contained in:
parent
55326dab7d
commit
c108ea3732
4 changed files with 11 additions and 27 deletions
|
@ -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'
|
||||
})
|
||||
})
|
||||
})()
|
||||
})
|
Reference in a new issue