News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Code within spoilers

Started by P.JBoy, September 05, 2017, 03:34:19 PM

Previous topic - Next topic

P.JBoy

As it stands, at least on Chrome, if I click to view a spoiler that contains code, the height of that code box is set to 20px. Looking at the code box element in the dev tools shows me that the element is explicitly set to have that height. The culprit is this smf_codeBoxFix. It attempts to set the height of code boxes to something sensible based on the offsetHeight (the physical height) of the box, but when the element is in a spoiler, the offsetHeight is correctly given as 0.

A possible fix would be to check if e.parentElement.className != "spoilerbody" as a condition in that same if statement. It would be as if that codeBoxFix function never executed, which is still better than the code being 20px high
...

Mon732

Cheers PJ, I'll get that fixed.