mirror of
https://github.com/golang/go
synced 2024-11-24 05:20:04 -07:00
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
This commit is contained in:
parent
0c58eff0b6
commit
a3b86e9379
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user