File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ type Msg msg
171171 | UserMsg msg
172172 | TweakExpandoMsg Expando . Msg
173173 | TweakExpandoModel Expando . Msg
174+ | Pause
174175 | Resume
175176 | Jump Int
176177 | SliderJump Int
@@ -234,6 +235,22 @@ wrapUpdate update msg model =
234235 , Cmd . none
235236 )
236237
238+ Pause ->
239+ case model. state of
240+ Running _ ->
241+ let
242+ size = History . size model. history
243+ in
244+ if size == 0 then
245+ ( model, Cmd . none )
246+ else
247+ ( jumpUpdate update ( size - 1 ) model
248+ , Cmd . none
249+ )
250+
251+ Paused _ _ userModel userMsg _ ->
252+ ( model, Cmd . none )
253+
237254 Resume ->
238255 case model. state of
239256 Running _ ->
@@ -686,7 +703,7 @@ viewPlayButton playing =
686703 , style " cursor" " pointer"
687704 , style " width" " 36px"
688705 , style " height" " 36px"
689- , onClick Resume
706+ , onClick ( if playing then Pause else Resume )
690707 ]
691708 [ if playing
692709 then icon " M2 2h4v12h-4v-12z M10 2h4v12h-4v-12z"
You can’t perform that action at this time.
0 commit comments