From 398cd3ba9f266cb1681a7bacdce7d911715b49e0 Mon Sep 17 00:00:00 2001
From: legac <renaud.legac@free.fr>
Date: Sun, 19 Jan 2014 18:43:11 +0100
Subject: [PATCH] Polish the plugin pGridMathJax.

---
 static/plugin_dbui/src/grid/plugin/MathJax.js | 29 ++++++++++++++-----
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/static/plugin_dbui/src/grid/plugin/MathJax.js b/static/plugin_dbui/src/grid/plugin/MathJax.js
index de88f2bb..bc3a83c1 100644
--- a/static/plugin_dbui/src/grid/plugin/MathJax.js
+++ b/static/plugin_dbui/src/grid/plugin/MathJax.js
@@ -47,17 +47,30 @@ Ext.define('App.grid.plugin.MathJax', {
         "use strict";
 
         var grid = this.getCmp(),
-            domEl = Ext.getDom(grid.getEl());
+            domEl = Ext.getDom(grid.getView().getEl());
 
-        // mask the grid durinf MathJax processing
+        /**
+         * 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'}
+        });
 
-        // push in the queue the mathjax processing
-        // followed by unlasking the grid
+        // push in the MatJax queue the processing
+        // followed by the unmasking
         MathJax.Hub.Queue(["Typeset", MathJax.Hub, domEl]);
-        MathJax.Hub.Queue([function (widget) {
-            "use strict";
-            widget.unmask();
-        }, grid])
+        MathJax.Hub.Queue([endOfTask, grid]);
     }
 });
\ No newline at end of file
-- 
GitLab