From 398477cb76fc8346a41afb11fc65d97eb24ba06e Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Wed, 12 Aug 2015 22:40:21 +0200 Subject: Input and label design glued together --- src/client/View/Payments/Add.elm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/client') diff --git a/src/client/View/Payments/Add.elm b/src/client/View/Payments/Add.elm index 3aa44c8..ce4738b 100644 --- a/src/client/View/Payments/Add.elm +++ b/src/client/View/Payments/Add.elm @@ -35,10 +35,9 @@ addPayment model addPayment = onSubmitPrevDefault actions.address (UpdatePayment <| UpdateAdd <| AddError (toMaybeError resName) (toMaybeError resCost)) ] [ div - [ class "name" ] + [ class ("name " ++ (if isJust addPayment.nameError then "error" else "")) ] [ input [ id "nameInput" - , class (if isJust addPayment.nameError then "error" else "") , value addPayment.name , on "input" targetValue (Signal.message actions.address << UpdatePayment << UpdateAdd << UpdateName) ] @@ -53,10 +52,9 @@ addPayment model addPayment = text "" ] , div - [ class "cost" ] + [ class ("cost " ++ (if isJust addPayment.costError then "error" else "")) ] [ input [ id "costInput" - , class (if isJust addPayment.costError then "error" else "") , value addPayment.cost , on "input" targetValue (Signal.message actions.address << UpdatePayment << UpdateAdd << UpdateCost) ] -- cgit v1.2.3