Commit a3b86e93 authored by Yasuhiro Matsumoto's avatar Yasuhiro Matsumoto Committed by Andrew Gerrand

misc/goplay: fix error on IE8.

        use cancelBubble=true instead of preventDefault().

R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/5888043
parent 0c58eff0
......@@ -209,17 +209,25 @@ function autoindent(el) {
}, 1);
}
function preventDefault(e) {
if (e.preventDefault) {
e.preventDefault();
} else {
e.cancelBubble = true;
}
}
function keyHandler(event) {
var e = window.event || event;
if (e.keyCode == 9) { // tab
insertTabs(1);
e.preventDefault();
preventDefault(e);
return false;
}
if (e.keyCode == 13) { // enter
if (e.shiftKey) { // +shift
compile(e.target);
e.preventDefault();
preventDefault(e);
return false;
} else {
autoindent(e.target);
......
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