From 361c68f8af52743ca6dde6428c17440ec09e0ec7 Mon Sep 17 00:00:00 2001 From: ichuang Date: Sat, 2 Jun 2012 17:57:37 -0400 Subject: [PATCH] another fix to dynamath display timing - problem.js content_updated display --- templates/problem.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/problem.js b/templates/problem.js index 3079b84a8f..30b68daafe 100644 --- a/templates/problem.js +++ b/templates/problem.js @@ -3,11 +3,11 @@ function ${ id }_content_updated() { update_schematics(); // dynamic math display: generate MathML on click - $.each($("[id^=input_${ id }_]"), function(index,value){ - theid = value.id.replace("input_",""); // ID of the response - if (document.getElementById("display_" + theid)){ + $.each($("[id^=display_${ id }_]"), function(index,value){ + theid = value.id.replace("display_",""); // ID of the response + if (document.getElementById("input_" + theid)){ MathJax.Hub.queue.Push(function () { - math = MathJax.Hub.getAllJax("display_" + theid)[0]; + math = MathJax.Hub.getAllJax(value.id)[0]; if (math){ math.Text(document.getElementById("input_" + theid).value); }