From 87e288cd01fbd04675a562bca582f7c2e591c010 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 1 Nov 2020 13:42:56 +0100 Subject: Improve a bit --- src/Timer/View.elm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Timer/View.elm b/src/Timer/View.elm index 561ae8f..662173a 100644 --- a/src/Timer/View.elm +++ b/src/Timer/View.elm @@ -60,7 +60,6 @@ nameBlockEdition id timer edition = , ("empty", isEmpty edition) ] |> classList - , onClick Msg.NoOp ] [ if isEmpty edition then @@ -79,7 +78,6 @@ timeBlockReadOnly : (Id, Timer) -> Html Msg timeBlockReadOnly (id, timer) = div [ class "time" - , onClick (Msg.Edit id Time) ] [ timeWithProgressBar (id, timer) ] @@ -91,7 +89,6 @@ timeBlockEdition (id, timer) edition = , ("empty", isEmpty edition) ] |> classList - , onClick Msg.NoOp ] [ if isEmpty edition then @@ -119,17 +116,18 @@ timeWithProgressBar (id, timer) = [ span [ class "progressBar" , let width = - 1 - timer.time / timer.initialTime - |> (*) 1020 - |> round + 1 - (timer.time / timer.initialTime) + |> (*) 100 |> toString - |> flip String.append "px" + |> flip String.append "%" in style [ ("width", width) ] - , onClick (Msg.UpdateTimer id Timer.Stop) + , onClick (if timer.state == Ringing then Msg.UpdateTimer id Timer.Stop else Msg.NoOp) ] [] , span - [ class "text" ] + [ class "text" + , onClick (Msg.Edit id Time) + ] [ text (timeView timer.time) ] ] -- cgit v1.2.3