diff options
| author | Joris Guyonvarch | 2015-07-21 23:25:58 +0200 | 
|---|---|---|
| committer | Joris Guyonvarch | 2015-07-21 23:25:58 +0200 | 
| commit | 2a53fe50c62d4b7aec0f422998c743f68aa523c1 (patch) | |
| tree | ad32464c99668b477c4006146ec218c947bc9c8f /src/client/View/Events.elm | |
| parent | a271d6034bc4cc631a64476d25d21c83a701fa39 (diff) | |
Adding the payment without reloading the page
Diffstat (limited to 'src/client/View/Events.elm')
| -rw-r--r-- | src/client/View/Events.elm | 19 | 
1 files changed, 19 insertions, 0 deletions
| diff --git a/src/client/View/Events.elm b/src/client/View/Events.elm new file mode 100644 index 0000000..1eb9027 --- /dev/null +++ b/src/client/View/Events.elm @@ -0,0 +1,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 +    ) | 
