Commit dc6288e
committed
Delay showing problem content until after MathJax content has rendered.
This was suggested by @dpvc in
openwebwork/pg#1431. The point is to prevent
the visual motion that occurs while the MathJax content is rendered.
This doesn't use the `#problem_body` id selector since that is not on
all problems (it isn't in Gateway tests), but uses the
`.problem-content` class selector instead, since that is on all
problems. Also, a `for of` loop and `document.querySelectorAll` is
needed for tests, since there can be more than one problem.
I am not entirely sold on the empty area shown in the mean time, but it
does prevent the jitter for the text within the problem. Perhaps if
someone wants to toy with css, a loading block could be shown with a
transition that fades in the problem when the MathJax rendering is
completed.
Note that webwork2 renders MathJax in places outside of the problem
content, and those will not be affected by this.1 parent d238e7b commit dc6288e
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| |||
134 | 141 | | |
135 | 142 | | |
136 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
137 | 148 | | |
0 commit comments