Fix problem with accessing MathInput before it is creatd in MSIE
This commit is contained in:
parent
d1b0893fec
commit
ae48b1fd8b
|
@ -59,17 +59,6 @@ input {margin-top: .7em}
|
||||||
window.UpdateMath = function (TeX) {
|
window.UpdateMath = function (TeX) {
|
||||||
QUEUE.Push(HIDEBOX,["Text",math,"\\displaystyle{"+TeX+"}"],SHOWBOX);
|
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>
|
</script>
|
||||||
|
|
||||||
|
@ -83,5 +72,18 @@ Type some \(\rm\TeX\) code and press RETURN:<br />
|
||||||
<div id="MathOutput" class="output">$${}$$</div>
|
<div id="MathOutput" class="output">$${}$$</div>
|
||||||
</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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user