Updated knowl.js for MathJax compatibility of hidden content
The following PR is based on the suggestions provided by MathJax.
Removed line 315, which previously called MathJax.typesetPromise() before the knowl's visibility was updated. MathJax could not accurately measure the dimensions of elements while they were still hidden (display: none).
Updated line 60 to delay the call to MathJax.typesetPromise() until after the knowl becomes visible, but before the unrolling animation begins. This ensures that MathJax has the correct layout context for typesetting, preventing layout shifts and improving the smoothness of the animation.
I verified that knowls containing mathematical content is rendered correctly without layout shifts and ensured that the unrolling animation remains smooth and that no visual glitches occur during the transition.
Thanks, @geoff-cox! I was just going to catch-up and encourage you to do this.
I'll try to take it for a spin, but input from @davidfarmer and @bnmnetp would be very helpful.
Took this for a drive and it looks good. Cross-reference knowls with math seem fine. Turned on lots of born-hidden knowls for the sample article and things like a Parsons problem with math inside a born-hidden knowl seem to be fine as well. Would like to have @davidfarmer check-off before merging.
Pinging @davidfarmer and @bnmnetp for input or check-off. Thanks.
Looks okay. Sorry it took so long.
Merged, with code as-is. Consolidated to a single commit with a one-line commit message.
Thanks for fixing this up - seems to be working great. Sorry for the delay, this one needed extra review (which I lost track of).