From 0075abf51db5d1b54117525d7a7f9b06e31c9484 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Tue, 17 Mar 2015 21:26:40 +0100 Subject: Adding an edition mode for a timer --- src/Update/Update.elm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Update/Update.elm') diff --git a/src/Update/Update.elm b/src/Update/Update.elm index aa31a84..fa11921 100644 --- a/src/Update/Update.elm +++ b/src/Update/Update.elm @@ -11,6 +11,7 @@ import Maybe import Model.Model (..) import Model.Timer (..) +import Model.TimerEdition (..) import Model.Id (..) import Model.IdGenerator (..) @@ -22,6 +23,8 @@ type Action = | DeltaTime Time | UpdateTimer Id TimerAction | RemoveTimer Id + | EditTimer Id + | ReadOnly updates : Signal.Channel Action updates = Signal.channel NoOp @@ -46,3 +49,7 @@ update action model = { model | timers <- Dict.update id (Maybe.map (updateTimer action)) model.timers } RemoveTimer id -> { model | timers <- Dict.remove id model.timers } + EditTimer id -> + { model | timerEdition <- Just (newTimerEdition id) } + ReadOnly -> + { model | timerEdition <- Nothing } -- cgit v1.2.3