Permalink
Browse files

Run a Reprocess on #solutionarea to fix fonts

Closes #44265.

Test Plan:
Loaded /exercises/square_roots_2.html a bunch of times and it looked nice.

Auditors: eater, cbhl
  • Loading branch information...
1 parent 023af51 commit ffc5c91ffb61a247c068540ee5797c29946674e8 @sophiebits sophiebits committed Apr 8, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 khan-exercise.js
View
@@ -1240,12 +1240,18 @@ var Khan = (function() {
// A working solution was generated
if (validator) {
+ // Have MathJax redo the font metrics for the solution area
+ // (ugh, this is gross)
+ MathJax.Hub.Queue(["Reprocess", MathJax.Hub,
+ $("#solutionarea")[0]]);
+
// Focus the first input
// Use .select() and on a delay to make IE happy
var firstInput = solutionarea.find(":input").first();
if ($(".calculator input:visible").length) {
firstInput = $(".calculator input");
}
+
setTimeout(function() {
if (!firstInput.is(":disabled")) {
firstInput.focus();

0 comments on commit ffc5c91

Please sign in to comment.