tao-test/app/taoQtiItem/views/js/portableLib/OAT/util/math.js

16 lines
575 B
JavaScript

define(['taoQtiItem/portableLib/jquery_2_1_1', 'mathJax'], function($, MathJax){
'use strict';
return {
render : function render($container){
if(MathJax){
$container.find('math').each(function(){
var $wrap;
var $math = $(this);
$math.wrap($('<span>', {'class' : 'math-renderer'}));
$wrap = $math.parent('.math-renderer');
MathJax.Hub.Queue(["Typeset", MathJax.Hub, $wrap[0]]);
});
}
}
};
});