Class “too-short” always applied
-
Hi,
Working with the Dyad 2 downloaded from WP.com, I noticed that the blocks on the front page will always have the fade-to-white effect no matter the length of the excerpt.
On previous versions this used to work better: the fade effect was only applied when the excerpt was longer than (80% of) the block height. Shorter content would not get this fade-out at the bottom.
The issue can be seen on the demo page https://dyad2demo.wordpress.com/ as well. All posts there have this fade-out effect including the one called “A short post” half way down the page. This one should not have the fade-out effect applied.
After a long search I have found the reason.
The script function adjustPosts() in global.js, meant to apply the class “too-short” to the wrapper div, will ALWAYS apply this class, no matter the length of the content because the wrapper auto-adjusts itself to the exact height of that content. Which in turn will cause the following “if smaller than or equal to” be true on all occasions.
if ( $innerContainHeight <= $wholeContentHeight ) { $contain.parent().addClass('too-short'); }
Simply change that to
if ( $innerContainHeight < $wholeContentHeight ) { $contain.parent().addClass('too-short'); }
and the issue is solved ??
The page I need help with: [log in to see the link]
- The topic ‘Class “too-short” always applied’ is closed to new replies.