Explorar o código

WIP: render page with react component

fix mathjax rendering trigger
Yuki Takei %!s(int64=8) %!d(string=hai) anos
pai
achega
accc674097
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      resource/js/components/Page/RevisionBody.js

+ 6 - 0
resource/js/components/Page/RevisionBody.js

@@ -24,6 +24,12 @@ export default class RevisionBody extends React.Component {
     }
     }
   }
   }
 
 
+  componentWillReceiveProps(nextProps) {
+    if (MathJax != null && this.props.isMathJaxEnabled && this.props.renderMathJaxOnInit) {
+      this.renderMathJax();
+    }
+  }
+
   renderMathJax() {
   renderMathJax() {
     MathJax.Hub.Queue(["Typeset", MathJax.Hub, this.element]);
     MathJax.Hub.Queue(["Typeset", MathJax.Hub, this.element]);
   }
   }