diff options
author | Joris | 2020-11-01 13:42:56 +0100 |
---|---|---|
committer | Joris | 2020-11-01 13:42:56 +0100 |
commit | 87e288cd01fbd04675a562bca582f7c2e591c010 (patch) | |
tree | 5cb92d3cc6b4b084516fddf32ce30bcb25f2c335 /src/Timer/View.elm | |
parent | adaec3d1925477e0922bf6ed88a708db4c97d766 (diff) |
Improve a bit
Diffstat (limited to 'src/Timer/View.elm')
-rw-r--r-- | src/Timer/View.elm | 16 |
1 files changed, 7 insertions, 9 deletions
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) ] ] |