mirror of
https://github.com/britzl/monarch.git
synced 2025-06-27 10:27:49 +02:00
Add sequential loading flag (#62)
This commit is contained in:
parent
909ada9f18
commit
c7fb2ba646
@ -318,6 +318,7 @@ The options table can contain the following fields:
|
|||||||
* ```clear``` (boolean) - If the `clear` flag is set Monarch will search the stack for the screen that is to be shown. If the screen already exists in the stack and the clear flag is set Monarch will remove all screens between the current top and the screen in question.
|
* ```clear``` (boolean) - If the `clear` flag is set Monarch will search the stack for the screen that is to be shown. If the screen already exists in the stack and the clear flag is set Monarch will remove all screens between the current top and the screen in question.
|
||||||
* ```reload``` (boolean) - If the `reload` flag is set Monarch will reload the collection proxy if it's already loaded (this can happen if the previous screen was a popup).
|
* ```reload``` (boolean) - If the `reload` flag is set Monarch will reload the collection proxy if it's already loaded (this can happen if the previous screen was a popup).
|
||||||
* ```no_stack``` (boolean) - If the `no_stack` flag is set Monarch will load the screen without adding it to the screen stack.
|
* ```no_stack``` (boolean) - If the `no_stack` flag is set Monarch will load the screen without adding it to the screen stack.
|
||||||
|
* ```sequential``` (boolean) - If the `sequential` flag is set Monarch will start loading the screen only after the previous screen finished transitioning out.
|
||||||
|
|
||||||
|
|
||||||
### monarch.hide(screen_id, [callback])
|
### monarch.hide(screen_id, [callback])
|
||||||
|
@ -647,6 +647,8 @@ end
|
|||||||
-- * clear - Set to true if the stack should be cleared down to an existing instance of the screen
|
-- * clear - Set to true if the stack should be cleared down to an existing instance of the screen
|
||||||
-- * reload - Set to true if screen should be reloaded if it already exists in the stack and is loaded.
|
-- * reload - Set to true if screen should be reloaded if it already exists in the stack and is loaded.
|
||||||
-- This would be the case if doing a show() from a popup on the screen just below the popup.
|
-- This would be the case if doing a show() from a popup on the screen just below the popup.
|
||||||
|
-- * sequential - Set to true to wait for the previous screen to show itself out before starting the
|
||||||
|
-- show in transition even when transitioning to a different scene ID.
|
||||||
-- @param data (*) - Optional data to set on the screen. Can be retrieved by the data() function
|
-- @param data (*) - Optional data to set on the screen. Can be retrieved by the data() function
|
||||||
-- @param cb (function) - Optional callback to invoke when screen is shown
|
-- @param cb (function) - Optional callback to invoke when screen is shown
|
||||||
function M.show(id, options, data, cb)
|
function M.show(id, options, data, cb)
|
||||||
@ -692,7 +694,7 @@ function M.show(id, options, data, cb)
|
|||||||
-- wait until we are done if showing the same screen as is already visible
|
-- wait until we are done if showing the same screen as is already visible
|
||||||
local same_screen = top and top.id == screen.id
|
local same_screen = top and top.id == screen.id
|
||||||
show_out(top, screen, callbacks.track())
|
show_out(top, screen, callbacks.track())
|
||||||
if same_screen then
|
if same_screen or (options and options.sequential) then
|
||||||
callbacks.yield_until_done()
|
callbacks.yield_until_done()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user