Snap.html: Focus the world canvas on startup

so Snap reacts to keyboard events right away (without having to click
on the IDE first)
pull/3/merge
jmoenig 2014-05-20 09:29:19 +02:00
rodzic a53c189e4b
commit 669d93a629
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -2128,4 +2128,5 @@ ______
140520
------
* Morphic: Prevent default action for ctrl-/cmd-key events
* Morphic: Prevent default action for ctrl-/cmd-key event
* Snap.html: Focus the world canvas on startup, so Snap reacts to keyboard events right away

Wyświetl plik

@ -22,6 +22,7 @@
var world;
window.onload = function () {
world = new WorldMorph(document.getElementById('world'));
world.worldCanvas.focus();
new IDE_Morph().openIn(world);
setInterval(loop, 1);
};