aboutsummaryrefslogtreecommitdiff
path: root/emccpre.js
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-11-12 17:21:03 +0000
committerBen Harris <bjh21@bjh21.me.uk>2022-11-12 17:21:03 +0000
commit5a90dd9312ed2568d1d7f4b2f728614c29ee0f85 (patch)
treecda8702b2dae82168a061407b50d112deac811b0 /emccpre.js
parent8ef28a4fd6b3b111b3d2c0446d9d82784d239d22 (diff)
downloadpuzzles-5a90dd9312ed2568d1d7f4b2f728614c29ee0f85.zip
puzzles-5a90dd9312ed2568d1d7f4b2f728614c29ee0f85.tar.gz
puzzles-5a90dd9312ed2568d1d7f4b2f728614c29ee0f85.tar.bz2
puzzles-5a90dd9312ed2568d1d7f4b2f728614c29ee0f85.tar.xz
js: Give keyboard focus to the puzzle canvas at startup again
I think this has been broken since a752e73, when the canvas changed to being hidden, and hence unable to receive keyboard focus, when the page loaded. I've now moved the focus() call to after the canvas gets displayed.
Diffstat (limited to 'emccpre.js')
-rw-r--r--emccpre.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/emccpre.js b/emccpre.js
index c4165bb..16833f5 100644
--- a/emccpre.js
+++ b/emccpre.js
@@ -448,9 +448,6 @@ function initPuzzle() {
permalink_desc = document.getElementById("permalink-desc");
permalink_seed = document.getElementById("permalink-seed");
- // Default to giving keyboard focus to the puzzle.
- onscreen_canvas.focus();
-
// Create the resize handle.
var resize_handle = document.createElement("canvas");
resize_handle.width = 10;
@@ -575,5 +572,8 @@ function initPuzzle() {
var apology = document.getElementById("apology");
if (apology !== null) apology.style.display = "none";
document.getElementById("puzzle").style.display = "";
+
+ // Default to giving keyboard focus to the puzzle.
+ onscreen_canvas.focus();
};
}