Skip to content

Commit

Permalink
Use Mouse.position json decoder for click event
Browse files Browse the repository at this point in the history
  • Loading branch information
mwunsch committed Oct 5, 2016
1 parent 808052c commit 9ab7bb5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Main.elm
Expand Up @@ -132,10 +132,7 @@ subscriptions game =
onClickWithCoords : (Mouse.Position -> msg) -> Html.Attribute msg
onClickWithCoords message =
on "click" <|
Json.map message <|
Json.object2 Mouse.Position
("clientX" := Json.int)
("clientY" := Json.int)
Json.map message Mouse.position


view : GameState -> Html Msg
Expand Down

0 comments on commit 9ab7bb5

Please sign in to comment.