uidriver: Remove force focusing by clicking the body

As long as the game is embedded in an iframe, this is no longer
needed.
This commit is contained in:
Hajime Hoshi 2020-08-22 18:40:31 +09:00
parent bd888f62b9
commit dea716c9a6

View File

@ -292,13 +292,6 @@ func init() {
bodyStyle.Set("margin", "0")
bodyStyle.Set("padding", "0")
// TODO: This is OK as long as the game is in an independent iframe.
// What if the canvas is embedded in a HTML directly?
document.Get("body").Call("addEventListener", "click", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
canvas.Call("focus")
return nil
}))
canvasStyle := canvas.Get("style")
canvasStyle.Set("width", "100%")
canvasStyle.Set("height", "100%")