diff --git a/package-lock.json b/package-lock.json index 688a2d60..91a35009 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "24.3.3", + "version": "24.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "24.3.3", + "version": "24.3.4", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.5.0", diff --git a/package.json b/package.json index e7fd4875..ee65dfe5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "24.3.3", + "version": "24.3.4", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "scripts": { diff --git a/src/assets/scripts/index.js b/src/assets/scripts/index.js index 0f1ece96..e9512991 100644 --- a/src/assets/scripts/index.js +++ b/src/assets/scripts/index.js @@ -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', () => {