aboutsummaryrefslogtreecommitdiff
path: root/emccpre.js
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2013-04-05 15:49:21 +0000
committerSimon Tatham <anakin@pobox.com>2013-04-05 15:49:21 +0000
commite6afc02942ffd4e3738c5a0ac28a14bbbe345ba8 (patch)
treec32f0f282dfa4046176d699a8f0b18e853b13d74 /emccpre.js
parent8f87f2ce894f6ba017581abb89e2e0927067bed7 (diff)
downloadpuzzles-e6afc02942ffd4e3738c5a0ac28a14bbbe345ba8.zip
puzzles-e6afc02942ffd4e3738c5a0ac28a14bbbe345ba8.tar.gz
puzzles-e6afc02942ffd4e3738c5a0ac28a14bbbe345ba8.tar.bz2
puzzles-e6afc02942ffd4e3738c5a0ac28a14bbbe345ba8.tar.xz
IE doesn't default to giving focus to the puzzle canvas on a mouse
click, so manually implement that behaviour. (Without it, it's quite hard to focus the canvas at all in IE.) [originally from svn r9806]
Diffstat (limited to 'emccpre.js')
-rw-r--r--emccpre.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/emccpre.js b/emccpre.js
index 430aae4..38d7815 100644
--- a/emccpre.js
+++ b/emccpre.js
@@ -233,6 +233,12 @@ function initPuzzle() {
command(2);
};
+ // In IE, the canvas doesn't automatically gain focus on a mouse
+ // click, so make sure it does
+ onscreen_canvas.addEventListener("mousedown", function(event) {
+ onscreen_canvas.focus();
+ });
+
// In our dialog boxes, Return and Escape should be like pressing
// OK and Cancel respectively
document.addEventListener("keydown", function(event) {