From 0886d5916ae28e2a0d1d5c70fb81842a6d0dc70f Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 25 Jun 2016 22:51:12 +0200 Subject: Add a remove icon to empty a input text field --- src/client/elm/LoggedIn/Home/Header/View.elm | 17 +++++++++-------- src/client/elm/LoggedIn/Home/View/Expand.elm | 2 +- src/client/elm/LoggedIn/Home/View/Table.elm | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/client/elm/LoggedIn/Home') diff --git a/src/client/elm/LoggedIn/Home/Header/View.elm b/src/client/elm/LoggedIn/Home/Header/View.elm index f9fbb6a..67ff1f4 100644 --- a/src/client/elm/LoggedIn/Home/Header/View.elm +++ b/src/client/elm/LoggedIn/Home/Header/View.elm @@ -11,6 +11,7 @@ import Dict import Form exposing (Form) import View.Form as Form +import View.Events exposing (onSubmitPrevDefault) import Msg exposing (Msg) import LoggedIn.Msg as LoggedInMsg @@ -50,14 +51,14 @@ searchLine loggedData search frequency = searchForm : LoggedData -> Form String Home.Search -> Html Msg searchForm loggedData search = - let htmlMap = Html.map (Msg.UpdateLoggedIn << LoggedInMsg.HomeMsg << HomeMsg.SearchMsg) - in Html.form - [] - [ Form.textInput loggedData.translations search htmlMap "search" "name" - , if List.isEmpty (Payment.monthly loggedData.payments) - then text "" - else Form.radioInputs loggedData.translations search htmlMap "search" "frequency" [ toString Punctual, toString Monthly ] - ] + Html.map (Msg.UpdateLoggedIn << LoggedInMsg.HomeMsg << HomeMsg.SearchMsg) <| + Html.form + [ onSubmitPrevDefault Form.NoOp ] + [ Form.textInput loggedData.translations search "search" "name" + , if List.isEmpty (Payment.monthly loggedData.payments) + then text "" + else Form.radioInputs loggedData.translations search "search" "frequency" [ toString Punctual, toString Monthly ] + ] infos : LoggedData -> Payments -> Html Msg infos loggedData payments = diff --git a/src/client/elm/LoggedIn/Home/View/Expand.elm b/src/client/elm/LoggedIn/Home/View/Expand.elm index e0c13a3..2bcfec1 100644 --- a/src/client/elm/LoggedIn/Home/View/Expand.elm +++ b/src/client/elm/LoggedIn/Home/View/Expand.elm @@ -3,7 +3,7 @@ module LoggedIn.Home.View.Expand exposing , ExpandType(..) ) -import Color exposing (Color) +import View.Color as Color import FontAwesome diff --git a/src/client/elm/LoggedIn/Home/View/Table.elm b/src/client/elm/LoggedIn/Home/View/Table.elm index 9cd43a7..323a45d 100644 --- a/src/client/elm/LoggedIn/Home/View/Table.elm +++ b/src/client/elm/LoggedIn/Home/View/Table.elm @@ -5,9 +5,9 @@ module LoggedIn.Home.View.Table exposing import Dict exposing (..) import Date exposing (Date) import String exposing (append) -import Color import FontAwesome +import View.Color as Color import Html exposing (..) import Html.Attributes exposing (..) -- cgit v1.2.3