fix: js err
This commit is contained in:
parent
f101d122c0
commit
0967da50f7
3 changed files with 6 additions and 3 deletions
|
@ -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', () => {
|
||||
|
|
Reference in a new issue