From b3076f37700291221ededbaf996a065b006cf42d Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 22 Mar 2015 17:13:04 +0100 Subject: Do not add more than one space when editing name --- src/View/Timer.elm | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/View/Timer.elm') 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 = -- cgit v1.2.3