Commit 99b0eefd authored by Dmitry Chestnykh's avatar Dmitry Chestnykh Committed by Andrew Gerrand

misc/goplay: fix Tab and Shift+Enter in Firefox.

Fixes #1633.

R=adg, dsymonds
CC=golang-dev
https://golang.org/cl/4439042
parent 90e4ece3
......@@ -235,8 +235,8 @@ function autoindent(el) {
}, 1);
}
function keyHandler() {
var e = window.event;
function keyHandler(event) {
var e = window.event || event;
if (e.keyCode == 9) { // tab
insertTabs(1);
e.preventDefault();
......@@ -290,7 +290,7 @@ function compileUpdate() {
</head>
<body>
<table width="100%"><tr><td width="60%" valign="top">
<textarea autofocus="true" id="edit" spellcheck="false" onkeydown="keyHandler();" onkeyup="autocompile();">«@|html»</textarea>
<textarea autofocus="true" id="edit" spellcheck="false" onkeydown="keyHandler(event);" onkeyup="autocompile();">«@|html»</textarea>
<div class="hints">
(Shift-Enter to compile and run.)&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" id="autocompile" value="checked" /> Compile and run after each keystroke
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment