Navigation Icons
Overview
Component Name: gpii.firstDiscovery.navIcons
File: navIcons.js
Wraps the set of Navigation Icons and assists in determining the position of each navigation icon.
Using the Navigation Icons component
Option 1: Typically this component is used as a sub-component of the Navigation:
navIcons: {
type: "gpii.firstDiscovery.navIcons",
container: "{nav}.dom.navIcons",
options: {}
}
Option 2: Outside the context of the First Discovery Tool, developers may wish to create a standalone component:
var myNavIcons = gpii.firstDiscovery.navIcons(container, options);
Grades
This component uses the following base grades:
Model
This component supports the following model properties:
Path | Description | Values | Default |
---|---|---|---|
pageNum |
Corresponds to the index of the current panel. | Panel ID (Number) | 0 |
iconWidth |
The width of the icon. Used to determine where to scroll to make it visible. | Number (in pixels) | 0 |
Supported Events
This component supports the following events:
Event | Type | Description | Parameters |
---|---|---|---|
onCreateIcon |
default | Fired to trigger the creation of each navigation icon |
|
onSetConfirmedIcon |
default | Fired to trigger a specific panel icon to show confirmed state |
|
onSetActiveIcon |
default | Fired to trigger a specific panel icon to show active state |
|
Methods
Method | Description | Parameters |
---|---|---|
showIconPage |
Scrolls the icon container to make sure the current active icon is visible. | none |
Subcomponents
This component has the following subcomponents:
Name | Description | Values | Default |
---|---|---|---|
icon |
This is a dynamic component. A new instance is created when the onCreateIcon event is fired. |
"gpii.firstDiscovery.icon" |
|
Options
This component can be configured using the following options:
Name | Description | Values | Default |
---|---|---|---|
pageSize |
The maximum number of icons to show at a time. | Number |
|
iconHoles |
A list of all the panel positions which have no Navigation Icons. | An array of indexes (Number) |
|
selectors |
Javascript object containing selectors for various fragments of the markup, including the containers for the subcomponents. | See Selectors below | |
modelListeners |
JavaScript object containing model paths and the listeners that are activated when changes happen to those paths | Keys in the object are event names, values are functions or arrays of functions. | See Model above |
Selectors
One of the options that can be provided to Infusion components is a set of CSS-based selectors identifying where in the DOM different elements can be found. Components use a DOM Binder to access the named elements.
The value for the selectors
option is itself a Javascript object containing name/value pairs:
selectors: {
selector1Name: "selector 1 string",
selector2Name: "selector 2 string",
...
}
Selector Name | Description | Default |
---|---|---|
icon |
The set of containers to render the Navigation Icons. | ".gpiic-fd-navIcon" |
pager |
The container of the Navigation Icons. | ".gpii-fd-navIcon-outer" |
Dependencies
<script type="text/javascript" src="src/lib/infusion/infusion-custom.js"></script>
<script type="text/javascript" src="src/js/navIcons.js"></script>