Yield focus to canvas on clicking body

This commit is contained in:
Hajime Hoshi 2015-01-07 04:39:33 +09:00
parent 795e7c8eb2
commit 74e3c40740

View File

@ -71,6 +71,9 @@ func init() {
bodyStyle.Set("height", "100%")
bodyStyle.Set("margin", "0")
bodyStyle.Set("padding", "0")
doc.Get("body").Set("onclick", func() {
canvas.Call("focus")
})
canvasStyle := canvas.Get("style")
canvasStyle.Set("position", "absolute")