From e0d4473ff722ac80f2e7a0dc9d55b51fe9d9e1fb Mon Sep 17 00:00:00 2001
From: Renaud Le Gac <legac@cppm.in2p3.fr>
Date: Fri, 14 Feb 2014 18:31:53 +0100
Subject: [PATCH] Polish the mathjax plugin.

---
 static/plugin_dbui/src/grid/plugin/MathJax.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/static/plugin_dbui/src/grid/plugin/MathJax.js b/static/plugin_dbui/src/grid/plugin/MathJax.js
index 6324713d..f1488e7e 100644
--- a/static/plugin_dbui/src/grid/plugin/MathJax.js
+++ b/static/plugin_dbui/src/grid/plugin/MathJax.js
@@ -24,8 +24,10 @@ Ext.define('App.grid.plugin.MathJax', {
 
         this.setCmp(grid);
 
+        // process latex formula each time the grid is refreshed
+        // NOTE: Mathajax processing is lost when the gridView is
+        // modified (sort, filter, add, remove or delete).
         grid.getView().on('refresh', this.onProcessMath, this);
-        grid.getStore().on('write', this.onProcessMath, this);
     },
 
     /**
@@ -35,10 +37,7 @@ Ext.define('App.grid.plugin.MathJax', {
 
         "use strict";
 
-        var grid = this.getCmp();
-
-        grid.getView().un('refresh', this.onProcessMath, this);
-        grid.getStore().un('write', this.onProcessMath, this);
+        this.getCmp().getView().un('refresh', this.onProcessMath, this);
     },
 
     /**
-- 
GitLab