mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
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.
This commit is contained in:
@ -448,9 +448,6 @@ function initPuzzle() {
|
|||||||
permalink_desc = document.getElementById("permalink-desc");
|
permalink_desc = document.getElementById("permalink-desc");
|
||||||
permalink_seed = document.getElementById("permalink-seed");
|
permalink_seed = document.getElementById("permalink-seed");
|
||||||
|
|
||||||
// Default to giving keyboard focus to the puzzle.
|
|
||||||
onscreen_canvas.focus();
|
|
||||||
|
|
||||||
// Create the resize handle.
|
// Create the resize handle.
|
||||||
var resize_handle = document.createElement("canvas");
|
var resize_handle = document.createElement("canvas");
|
||||||
resize_handle.width = 10;
|
resize_handle.width = 10;
|
||||||
@ -575,5 +572,8 @@ function initPuzzle() {
|
|||||||
var apology = document.getElementById("apology");
|
var apology = document.getElementById("apology");
|
||||||
if (apology !== null) apology.style.display = "none";
|
if (apology !== null) apology.style.display = "none";
|
||||||
document.getElementById("puzzle").style.display = "";
|
document.getElementById("puzzle").style.display = "";
|
||||||
|
|
||||||
|
// Default to giving keyboard focus to the puzzle.
|
||||||
|
onscreen_canvas.focus();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user