From 2a53fe50c62d4b7aec0f422998c743f68aa523c1 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Tue, 21 Jul 2015 23:25:58 +0200 Subject: Adding the payment without reloading the page --- src/client/View/Events.elm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/client/View/Events.elm (limited to 'src/client/View/Events.elm') 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 + ) -- cgit v1.2.3