From 185228bbe6bc3c51428effe3256c0d1e51867f89 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Fri, 9 Feb 2018 12:54:34 +0100
Subject: [PATCH] reopening info window with kinetics will invoke mathjax
 reprocess code

---
 .../src/main/js/map/window/ReactionInfoWindow.js  | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/frontend-js/src/main/js/map/window/ReactionInfoWindow.js b/frontend-js/src/main/js/map/window/ReactionInfoWindow.js
index 273ae0e26f..346eab845d 100644
--- a/frontend-js/src/main/js/map/window/ReactionInfoWindow.js
+++ b/frontend-js/src/main/js/map/window/ReactionInfoWindow.js
@@ -19,16 +19,23 @@ function ReactionInfoWindow(params) {
   // call super constructor
   AbstractInfoWindow.call(this, params);
 
-  this.setReactionData(params.reaction);
+  var self = this;
+
+  self.setReactionData(params.reaction);
 
-  var reaction = this.getReactionData();
+  var reaction = self.getReactionData();
   var point = reaction.getCenter();
-  var latLng = this.getCustomMap().fromPointToLatLng(point);
+  var latLng = self.getCustomMap().fromPointToLatLng(point);
   this.googleInfowindow = new google.maps.InfoWindow({
     content: this.content,
     position: latLng
   });
-  this.googleInfowindow.open(this.getCustomMap().getGoogleMap(), this.getGoogleMarker());
+  if (params.reaction.getKineticLaw()!==undefined) {
+    self.addListener("onShow", function () {
+      return MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
+    });
+  }
+  self.googleInfowindow.open(self.getCustomMap().getGoogleMap(), self.getGoogleMarker());
 }
 
 ReactionInfoWindow.prototype = Object.create(AbstractInfoWindow.prototype);
-- 
GitLab