jedfoster/Readmore.js — pull request #74 by chriskief (2014-12-31 05:55:35+00:00)
Title: Fix for https://github.com/jedfoster/Readmore.js/issues/73

current.css('max-height') returns a string when the max-height of an element is set via CSS (https://github.com/jedfoster/Readmore.js/issues/73). Use parseInt to force to an integer.

The following fiddle demonstrates the issue: http://jsfiddle.net/xk9r38eq/

And this fiddle demonstrates the fix: http://jsfiddle.net/6eu1mmg6/

As can be seen in the console output, the maxHeight can now be added to the heightMargin correctly:

readmore_v2.js:79 - typeof current.css('max-height').replace(/[^-d.]/g, ''): string
readmore_v2.js:80 - typeof current.data('max-height'): number
readmore_v2.js:81 - typeof maxHeight: number
readmore_v2.js:82 - maxHeight + heightMargin:
readmore_v2.js:83 - 228

Would love to see this get merged this time around.