Only show gradient on truncated sidenotes/marginnotes

Check scrollHeight vs clientHeight to determine if content is actually
truncated before showing the fade gradient.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-14 16:50:31 -05:00
parent fe7a23306e
commit d2fc2748c7
+7 -2
View File
@@ -19,8 +19,8 @@
overflow: visible;
}
.sidenote:not(.expanded)::after,
.marginnote:not(.expanded)::after {
.sidenote.truncated:not(.expanded)::after,
.marginnote.truncated:not(.expanded)::after {
content: "";
position: absolute;
bottom: 0;
@@ -138,6 +138,11 @@ document.addEventListener('DOMContentLoaded', function() {
// Make sidenotes and marginnotes expandable and link verse references
sidenotes.forEach(function(sidenote) {
// Check if content is actually truncated
if (sidenote.scrollHeight > sidenote.clientHeight) {
sidenote.classList.add('truncated');
}
sidenote.addEventListener('click', function(e) {
// Don't expand if clicking a link
if (e.target.tagName !== 'A') {