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/Income/View.elm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/client/elm/LoggedIn/Income') diff --git a/src/client/elm/LoggedIn/Income/View.elm b/src/client/elm/LoggedIn/Income/View.elm index be15c6b..3019fea 100644 --- a/src/client/elm/LoggedIn/Income/View.elm +++ b/src/client/elm/LoggedIn/Income/View.elm @@ -5,7 +5,6 @@ module LoggedIn.Income.View exposing import Dict import Date import Time exposing (Time) -import Color import Task import FontAwesome @@ -14,7 +13,11 @@ import Html exposing (..) import Html.Events exposing (..) import Html.Attributes exposing (..) import Html.App as Html + import Form exposing (Form) +import View.Form as Form +import View.Events exposing (onSubmitPrevDefault) + import Dialog import Msg exposing (Msg) @@ -35,8 +38,6 @@ import LoggedIn.View.Date exposing (renderShortDate) import LoggedIn.View.Format as Format import LoggedIn.View.Date exposing (renderLongDate) -import View.Events exposing (onSubmitPrevDefault) -import View.Form as Form import View.Color as Color view : LoggedData -> IncomeModel.Model -> Html Msg @@ -80,10 +81,11 @@ addIncomeView loggedData addIncome = let htmlMap = Html.map (Msg.UpdateLoggedIn << LoggedInMsg.IncomeMsg << IncomeMsg.AddIncomeMsg) in Html.form [ onSubmitPrevDefault Msg.NoOp ] - [ Form.textInput loggedData.translations addIncome htmlMap "income" "creation" - , Form.textInput loggedData.translations addIncome htmlMap "income" "amount" + [ htmlMap <| Form.textInput loggedData.translations addIncome "income" "creation" + , htmlMap <| Form.textInput loggedData.translations addIncome "income" "amount" , button - [ case Form.getOutput addIncome of + [ class "add" + , case Form.getOutput addIncome of Just data -> onClick (Msg.UpdateLoggedIn <| LoggedInMsg.AddIncome data.time data.amount) Nothing -> -- cgit v1.2.3