Allow popping to the root view controller in the nav stack.

This commit is contained in:
Mark Rickert
2013-06-27 15:07:55 -04:00
committed by Jamon Holmgren
parent 2da5fe93df
commit ed862648bb
2 changed files with 26 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ module ProMotion
self.split_screen.detail_screen = screen
elsif args[:in_master] && self.split_screen
self.split_screen.master_screen = screen
self.split_screen.master_screen = screen
elsif args[:close_all]
open_root_screen screen
@@ -41,6 +41,10 @@ module ProMotion
app_delegate.open_root_screen(screen)
end
def pop_to_root(animated = false)
self.navigation_controller.popToRootViewControllerAnimated animated
end
def open_modal(screen, args = {})
open screen, args.merge({ modal: true })
end
@@ -94,7 +98,7 @@ module ProMotion
# Instantiate screen if given a class
screen = screen.new if screen.respond_to?(:new)
# Set parent
screen.parent_screen = self if screen.respond_to?(:parent_screen=)