3
0
mirror of https://github.com/britzl/monarch.git synced 2025-09-28 02:22:20 +02:00

Added monarch.top() and bottom()

This commit is contained in:
Björn Ritzl
2018-06-04 13:56:45 +02:00
parent 0fdfb6fd11
commit 66b1f7ca2e
3 changed files with 65 additions and 1 deletions

View File

@@ -261,6 +261,26 @@ Preload a Monarch screen. This will load but not enable the screen. This is usef
* ```callback``` (function) - Optional function to call when the new screen is preloaded.
### monarch.top([offset])
Get the id of the screen at the top of the stack.
**PARAMETERS**
* ```offset``` (number) - Optional offset from the top of the stack, ie -1 to get the previous screen
**RETURN**
* ```screen_id``` (hash) - Id of the requested screen
### monarch.bottom([offset])
Get the id of the screen at the bottom of the stack.
**PARAMETERS**
* ```offset``` (number) - Optional offset from the bottom of the stack
**RETURN**
* ```screen_id``` (hash) - Id of the requested screen
### monarch.data(screen_id)
Get the data associated with a screen (from a call to ```monarch.show()``` or ```monarch.back()```).