Skip to content
Snippets Groups Projects
Commit 8ac15451 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

JaxMath onload event moved to the right place

parent 47565db8
No related branches found
No related tags found
Loading
......@@ -343,11 +343,6 @@ Functions.loadScript = function (url) {
script.type = 'text/javascript';
script.src = url;
script.onload = function () {
MathJax.Hub.Config({
tex2jax: {
skipTags: ["script", "noscript", "style", "textarea", "pre", "code"]
}
});
resolve();
};
head.appendChild(script);
......
......@@ -59,6 +59,13 @@ ReactionInfoWindow.prototype.createContentDiv = function () {
} else {
var kineticLaw = reaction.getKineticLaw();
return Functions.loadScript('https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML').then(function () {
return MathJax.Hub.Config({
tex2jax: {
skipTags: ["script", "noscript", "style", "textarea", "pre", "code"]
}
});
}).then(function () {
result.appendChild(Functions.createElement({type: "h4", content: "Kinetic law"}));
if (kineticLaw.getMathMlPresentation() !== undefined) {
......
......@@ -27,7 +27,15 @@ function mockBootstrap() {
}
before(function () {
require('../../main/js/Functions').loadScript = Promise.resolve;
require('../../main/js/Functions').loadScript = function () {
global.MathJax = {
Hub: {
Config: function () {
}
}
};
return Promise.resolve();
};
// requirejs.config({
// baseUrl: path.dirname(require.main.filename) + "/../../../"
// });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment