aboutsummaryrefslogtreecommitdiff
path: root/src/View/Timer.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/View/Timer.elm')
-rw-r--r--src/View/Timer.elm20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/View/Timer.elm b/src/View/Timer.elm
index 2325d3a..9c302a4 100644
--- a/src/View/Timer.elm
+++ b/src/View/Timer.elm
@@ -37,7 +37,7 @@ timerView model (id, timer) =
, restartBlock (id, timer)
, playPauseBlock (id, timer)
, stopBlock (id, timer)
- , removeBlock (id, timer)
+ , removeBlock model (id, timer)
]
nameBlock : (Id, Timer) -> Html
@@ -105,13 +105,17 @@ stopBlock (id, timer) =
]
[ i [ class "fa fa-fw fa-stop" ] [] ]
-removeBlock : (Id, Timer) -> Html
-removeBlock (id, timer) =
- button
- [ class <| "remove block"
- , onClick (Signal.send updates (RemoveTimer id))
- ]
- [ i [ class "fa fa-fw fa-remove" ] [] ]
+removeBlock : Model -> (Id, Timer) -> Html
+removeBlock model (id, timer) =
+ let removeClass =
+ if numberOfTimers model > 1
+ then "remove"
+ else "singleRemove"
+ in button
+ [ class <| "block " ++ removeClass
+ , onClick (Signal.send updates (RemoveTimer id))
+ ]
+ [ i [ class "fa fa-fw fa-remove" ] [] ]
stopIfRinging : (Id, Timer) -> Signal.Message -> Signal.Message
stopIfRinging (id, timer) message =