Fix problem with accessing MathInput before it is creatd in MSIE

This commit is contained in:
Davide P. Cervone 2011-12-23 10:40:10 -05:00
parent d1b0893fec
commit ae48b1fd8b

View File

@ -59,17 +59,6 @@ input {margin-top: .7em}
window.UpdateMath = function (TeX) {
QUEUE.Push(HIDEBOX,["Text",math,"\\displaystyle{"+TeX+"}"],SHOWBOX);
}
//
// IE doesn't fire onchange events for RETURN, so
// use onkeypress to do a blur (and refocus) to
// force the onchange to occur
//
if (MathJax.Hub.Browser.isMSIE) {
window.MathInput.onkeypress = function () {
if (window.event && window.event.keyCode === 13) {this.blur(); this.focus()}
}
}
})();
</script>
@ -83,5 +72,18 @@ Type some \(\rm\TeX\) code and press RETURN:<br />
<div id="MathOutput" class="output">$${}$$</div>
</div>
<script>
//
// IE doesn't fire onchange events for RETURN, so
// use onkeypress to do a blur (and refocus) to
// force the onchange to occur
//
if (MathJax.Hub.Browser.isMSIE) {
MathInput.onkeypress = function () {
if (window.event && window.event.keyCode === 13) {this.blur(); this.focus()}
}
}
</script>
</body>
</html>