new Navigator(ui, container, uniqueId)
- Description:
Navigation controller
Parameters:
Name | Type | Description |
---|---|---|
ui |
Simplicite.UI.Engine | Main UI controller |
container |
jQuery | Optional container (popup, div...) |
uniqueId |
string | Optional navigator Id (default is the container#id if any) |
Methods
addHistory()
- Description:
Add a history of opened object in main navigation
clearHistory()
- Description:
Clear sysparam HISTORY
focus(apply)
- Description:
Preserve page focus. If the previous focus is not found, try to focus the first visible '.js-focusable' in container
Parameters:
Name | Type | Description |
---|---|---|
apply |
boolean | true to restore focus, false to keep activeElement infos |
getCurrentItem()
- Description:
Current element
getHistory()
- Description:
Session history
getItem()
- Description:
Navigation element
getItems()
- Description:
Navigation history
getRootItem()
- Description:
Root element
leave(y)
- Description:
Preserve nav informations (scroll and focus)
Parameters:
Name | Type | Description |
---|---|---|
y |
number | save the scrollTop + focus of nav container |
length()
- Description:
Navigation length
loadHistory()
- Description:
Load sysparam HISTORY
nav(action, item)
- Description:
Navigation. Returns the current item.
Parameters:
Name | Type | Description |
---|---|---|
action |
Optional |
|
item |
Item to push in navigation
|
navBack(n, params)
- Description:
Returns back in navigation
Parameters:
Name | Type | Description |
---|---|---|
n |
backward iterations (default 1, reload 0) |
|
params |
Optional additive parameters (to display messages or to override old parameters) |
navId(id)
- Description:
Navigator Id to isolate its object instances
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Optional value to set the unique id |
navTo(n, params)
- Description:
Navigate to item. Returns to home if unknown.
Parameters:
Name | Type | Description |
---|---|---|
n |
Navigation item or index, default is the last one |
|
params |
Optional additive parameters (to display messages or to override old parameters) |
reload()
- Description:
Reload current navigation and notify js-reload components
restore()
- Description:
Restore nav informations (scroll and focus)
saveHistory()
- Description:
Save sysparam HISTORY
vscroll(apply)
- Description:
Preserve vertical scroll of current nav
Parameters:
Name | Type | Description |
---|---|---|
apply |
boolean | number | apply when true or save the scrollTop of nav container |