From 4e5f27a5b1428b9ad190a87a6bf0d4fe187387c9 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Mon, 16 Mar 2015 20:37:44 +0100 Subject: Adding a remove button to delete a timer --- src/View/Timer.elm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/View') diff --git a/src/View/Timer.elm b/src/View/Timer.elm index 668bf08..13f071c 100644 --- a/src/View/Timer.elm +++ b/src/View/Timer.elm @@ -18,15 +18,20 @@ import Update.UpdateTimer (..) timerView : (Id, Timer) -> Html timerView (id, timer) = div - [ class "timer" ] - [ div - [ class "block" ] - [ text timer.name ] - , div - [ class <| "timerTime block" ++ (if timer.isRunning then " isRunning" else "") + [ class <| "timer" ++ (if timer.isRunning then " isRunning" else "") ] + [ button + [ class "name block" , onClick (Signal.send updates (UpdateTimer id ToggleRunning)) ] + [ text timer.name ] + , div + [ class <| "time block" ] [ text (timeView timer.time) ] + , button + [ class <| "remove block" + , onClick (Signal.send updates (RemoveTimer id)) + ] + [ i [ class "fa fa-fw fa-remove" ] [] ] ] timeView : Time -> String -- cgit v1.2.3