aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/View/Events.elm
blob: c9dff9fb1da5d3353176b4c67f524ad54283ebd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module View.Events
  ( onSubmitPrevDefault
  ) where

import Signal
import Json.Decode as Json
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)

onSubmitPrevDefault : Signal.Address a -> a -> Attribute
onSubmitPrevDefault address value =
  onWithOptions
    "submit"
    { defaultOptions | preventDefault = True }
    Json.value
    (\_ ->
      Signal.message address value
    )