Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
6a16af2a
Commit
6a16af2a
authored
Sep 12, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MathJax initial render needs to be properly queued
parent
3173334d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+9
-4
No files found.
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
6a16af2a
...
@@ -12,6 +12,7 @@ class @Problem
...
@@ -12,6 +12,7 @@ class @Problem
bind
:
=>
bind
:
=>
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
]
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
]
window
.
update_schematics
()
window
.
update_schematics
()
problem_prefix
=
@
element_id
.
replace
(
/problem_/
,
''
)
problem_prefix
=
@
element_id
.
replace
(
/problem_/
,
''
)
...
@@ -23,7 +24,11 @@ class @Problem
...
@@ -23,7 +24,11 @@ class @Problem
@
$
(
'section.action input.reset'
).
click
@
reset
@
$
(
'section.action input.reset'
).
click
@
reset
@
$
(
'section.action input.show'
).
click
@
show
@
$
(
'section.action input.show'
).
click
@
show
@
$
(
'section.action input.save'
).
click
@
save
@
$
(
'section.action input.save'
).
click
@
save
@
$
(
'input.math'
).
keyup
(
@
refreshMath
).
each
(
@
refreshMath
)
# Dynamath
@
$
(
'input.math'
).
keyup
(
@
refreshMath
)
@
$
(
'input.math'
).
each
(
index
,
element
)
=>
MathJax
.
Hub
.
Queue
[
@
refreshMath
,
null
,
element
]
updateProgress
:
(
response
)
=>
updateProgress
:
(
response
)
=>
if
response
.
progress_changed
if
response
.
progress_changed
...
@@ -297,7 +302,6 @@ class @Problem
...
@@ -297,7 +302,6 @@ class @Problem
refreshMath
:
(
event
,
element
)
=>
refreshMath
:
(
event
,
element
)
=>
element
=
event
.
target
unless
element
element
=
event
.
target
unless
element
elid
=
element
.
id
.
replace
(
/^input_/
,
''
)
elid
=
element
.
id
.
replace
(
/^input_/
,
''
)
target
=
"display_"
+
elid
target
=
"display_"
+
elid
# MathJax preprocessor is loaded by 'setupInputTypes'
# MathJax preprocessor is loaded by 'setupInputTypes'
...
@@ -308,9 +312,10 @@ class @Problem
...
@@ -308,9 +312,10 @@ class @Problem
eqn
=
$
(
element
).
val
()
eqn
=
$
(
element
).
val
()
if
mathjax_preprocessor
if
mathjax_preprocessor
eqn
=
mathjax_preprocessor
(
eqn
)
eqn
=
mathjax_preprocessor
(
eqn
)
MathJax
.
Hub
.
Queue
[
'Text'
,
jax
,
eqn
],
MathJax
.
Hub
.
Queue
([
'Text'
,
jax
,
eqn
],
[
@
updateMathML
,
jax
,
element
])
[
@
updateMathML
,
jax
,
element
]
return
# Explicit return for CoffeeScript
updateMathML
:
(
jax
,
element
)
=>
updateMathML
:
(
jax
,
element
)
=>
try
try
$
(
"#
#{
element
.
id
}
_dynamath"
).
val
(
jax
.
root
.
toMathML
''
)
$
(
"#
#{
element
.
id
}
_dynamath"
).
val
(
jax
.
root
.
toMathML
''
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment