Skip to content

Commit

Permalink
Define the unmount callback for the container menu
Browse files Browse the repository at this point in the history
  • Loading branch information
moncho committed Jul 24, 2018
1 parent 1f55b90 commit e306430
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/container_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (h *containersScreenEventHandler) handleCommand(command commandRunner, f fu

case docker.STOP:
prompt := appui.NewPrompt(
fmt.Sprintf("Do you want to remove container %s? (y/N)", id))
fmt.Sprintf("Do you want to stop container %s? (y/N)", id))
widgets.add(prompt)
forwarder := newEventForwarder()
f(forwarder)
Expand Down Expand Up @@ -444,6 +444,12 @@ func (h *containersScreenEventHandler) handleKey(key termbox.Key, f func(eventHa
showMenu := func(id string) error {
h.screen.Cursor.Reset()
widgets.ContainerMenu.ForContainer(id)
widgets.ContainerMenu.OnUnmount = func() error {
h.screen.Cursor.Reset()
h.dry.SetViewMode(Main)
f(viewsToHandlers[Main])
return refreshScreen()
}
h.dry.SetViewMode(ContainerMenu)
f(viewsToHandlers[ContainerMenu])
return refreshScreen()
Expand Down

0 comments on commit e306430

Please sign in to comment.