aboutsummaryrefslogtreecommitdiff
path: root/src/View
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-22 17:13:04 +0100
committerJoris Guyonvarch2015-03-22 17:13:04 +0100
commitb3076f37700291221ededbaf996a065b006cf42d (patch)
tree26535eb8756329565529f2c5383701aa41c06c17 /src/View
parente7237e9f2a01197890d85b6ecc223e4022630cb8 (diff)
Do not add more than one space when editing name
Diffstat (limited to 'src/View')
-rw-r--r--src/View/Timer.elm32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/View/Timer.elm b/src/View/Timer.elm
index 50144ef..a88f9dd 100644
--- a/src/View/Timer.elm
+++ b/src/View/Timer.elm
@@ -49,17 +49,18 @@ nameBlockEdition : Id -> Timer -> Edition -> Html
nameBlockEdition id timer edition =
div
[ [ (True, "name block edition")
- , (List.isEmpty edition.chars, "empty")
+ , (isEmpty edition, "empty")
]
|> activatedClasses
, onClick (Signal.send updates NoOp)
]
- [ if List.isEmpty edition.chars
+ [ if isEmpty edition
then
text (timerName id timer)
else
edition.chars
|> renderNameEdition
+ |> flip String.append "_"
|> text
]
@@ -83,20 +84,19 @@ timeBlockReadOnly id timer =
timeBlockEdition : Timer -> Edition -> Html
timeBlockEdition timer edition =
- let isEmptyEdition = List.isEmpty edition.chars
- in div
- [ [ (True, "time block edition")
- , (isEmptyEdition, "empty")
- ]
- |> activatedClasses
- , onClick (Signal.send updates NoOp)
- ]
- [ if isEmptyEdition
- then
- timeWithProgressBar timer
- else
- text (editionView edition.chars)
- ]
+ div
+ [ [ (True, "time block edition")
+ , (isEmpty edition, "empty")
+ ]
+ |> activatedClasses
+ , onClick (Signal.send updates NoOp)
+ ]
+ [ if isEmpty edition
+ then
+ timeWithProgressBar timer
+ else
+ text (editionView edition.chars)
+ ]
editionView : List Char -> String
editionView numbers =