diff --git a/static/plugin_dbui/src/grid/plugin/MathJax.js b/static/plugin_dbui/src/grid/plugin/MathJax.js index bc3a83c118b1a5223f764a802a4ce9179613fa3a..877a53bf210b1ee46f7c8f4c024b46f889b1835d 100644 --- a/static/plugin_dbui/src/grid/plugin/MathJax.js +++ b/static/plugin_dbui/src/grid/plugin/MathJax.js @@ -9,6 +9,9 @@ Ext.define('App.grid.plugin.MathJax', { extend: 'Ext.AbstractPlugin', alias: 'plugin.pGridMathJax', + // Private attributes for internationalization + textMask: 'Processing symbols', + /** * Initialize the plugin * @@ -47,30 +50,19 @@ Ext.define('App.grid.plugin.MathJax', { "use strict"; var grid = this.getCmp(), - domEl = Ext.getDom(grid.getView().getEl()); - - /** - * Call at the end of the MathJax processing. - * Remove the mask on the grid and hide the progress bar - * - * @param {App.grid.Panel} wdg - */ - function endOfTask (wdg) { - wdg.unmask(); - Ext.Msg.hide(); - } - - // mask the grid during MathJax processing and show a progress bar - grid.mask(); - Ext.Msg.show({ - wait: true, - waitConfig: { - text: 'processing symbols'} + domEl = Ext.getDom(grid.getView().getEl()), + loadMask; + + // mask the grid during MathJax processing + loadMask = Ext.create('Ext.LoadMask', { + target: grid, + msg: this.textMask }); - // push in the MatJax queue the processing - // followed by the unmasking + loadMask.show(); + + // push in the MatJax queue the processing followed by the unmasking MathJax.Hub.Queue(["Typeset", MathJax.Hub, domEl]); - MathJax.Hub.Queue([endOfTask, grid]); + MathJax.Hub.Queue([function (mask) {mask.hide();}, loadMask]); } }); \ No newline at end of file diff --git a/static/plugin_dbui/src/panel/WithUrlSelector.js b/static/plugin_dbui/src/panel/WithUrlSelector.js index c5aca3375fd2d60074be6059c1eacf84090c8e30..b526167c15ba90acabd5b3fada3fcb398901db90 100644 --- a/static/plugin_dbui/src/panel/WithUrlSelector.js +++ b/static/plugin_dbui/src/panel/WithUrlSelector.js @@ -168,11 +168,23 @@ Ext.define('App.panel.WithUrlSelector', { onLoad: function (loader, response, options) { "use strict"; + var domEl, + loadMask; // process symbols if (MathJax && this.isMathJax) { - MathJax.Hub.PreProcess(); - MathJax.Hub.Process(); + + domEl = Ext.getDom(this.mainPanel.getEl()); + + loadMask = Ext.create('Ext.LoadMask', { + target: this.mainPanel, + msg: 'Processing symbols' + }); + + loadMask.show(); + + MathJax.Hub.Queue(["Typeset", MathJax.Hub, domEl]); + MathJax.Hub.Queue([function (mask) {mask.hide();}, loadMask]); } // enable the selector