Skip to content
Snippets Groups Projects
Commit 08607adb authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

Remove the loading of the MathJax library since it is performed in the view.

parent 46badc62
No related branches found
No related tags found
No related merge requests found
......@@ -19,18 +19,10 @@ Ext.namespace('App');
* Configuration option for all json stores
*/
/**
* @cfg {Boolean} App.mathJax
* The path of the MathJax.js script.
* It is equal to undefined if it does not exist.
* This constants is defined by the server and should not be used directly.
* The plugin should be loaded with the function App.loadMathJax.
*/
/**
* @param {String} App.version version of the library
*/
App.version = '0.4.0'
App.version = '0.4.1'
/**
* Helper function mimicking the encode_field function running on the server
......@@ -119,22 +111,3 @@ App.isPlugin = function (component, ptype) {
}
return false;
};
/**
* Helper function to load the MathJax library
* The loading is an asynchronous operation.
* When finished the function callback is executed.
* If the library is not there the callback is executed to.
* @param {Function} callback
* @param {Object} scope scope for the callback
*/
App.loadMathJax = function (callback, scope) {
if (App.mathJax) {
Ext.Loader.load([App.mathJax], callback, scope);
} else {
callback.call(scope);
}
};
......@@ -13,14 +13,12 @@ App.grid.MathJax = Ext.extend(Object, {
init: function (grid) {
function processMath() {
MathJax.Hub.PreProcess();
MathJax.Hub.Process();
function processMath(gridView) {
var domEl = Ext.getDom(gridView.el);
MathJax.Hub.Queue(["Typeset",MathJax.Hub, domEl]);
}
// NOTE: in some case mathJax error appears on the first rendering
// Adding a delay of 0.1 s seems to fixed this problem
grid.getView().on('refresh', processMath, grid, {delay: 100});
grid.getView().on('refresh', processMath, grid);
}
});
......
......@@ -27,18 +27,9 @@ App.Mgr = Ext.extend(Object, {
constructor: function (config) {
Ext.apply(this, config);
App.Mgr.superclass.constructor.apply(this);
// If the MathJax library is required load it
App.loadMathJax(this.configure, this);
Dbui.getViewport(this.launch, this);
},
/**
* Callback function to get the viewport configuration from the server
*/
configure: function () {
Dbui.getViewport(this.launch, this);
},
/**
* Call back function to launch the application.
*
......
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