diff options
author | Joris Guyonvarch | 2015-03-17 21:26:40 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-17 21:26:40 +0100 |
commit | 0075abf51db5d1b54117525d7a7f9b06e31c9484 (patch) | |
tree | ed7a5b8c3ac74113dca96463a41dcd00548d20c8 /src/Update | |
parent | c3e8b1a4d428160976c5d9ad770763e8db02f3bc (diff) |
Adding an edition mode for a timer
Diffstat (limited to 'src/Update')
-rw-r--r-- | src/Update/Update.elm | 7 |
1 files changed, 7 insertions, 0 deletions
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 } |