Navigation Buttons API
Navigation Buttons Overview
Provides the back/next buttons for navigating between the panels of the First Discovery Tool.
Join the infusion-users mailing list and ask your questions there.
Adding a Navigation Buttons Component
Option 1: Typically used as a sub-component of a Navigation.
Adding as sub-component:
navButtons: { type: "gpii.firstDiscovery.navButtons", container: "{that}.dom.navButtons", options: {} }
Option 2: Adding as a stand alone component:
var myNavButtons = gpii.firstDiscovery.navButtons(container, options);
Grades
The base grades used by the Navigation Buttons:
Model
Path | Description | Values | Default |
---|---|---|---|
| The panel currently displayed. Must be in a range from | Panel ID ( | undefined |
isFirstPanel | Whether or not the current panel is the first panel. | Boolean | undefined |
isLastPanel | Whether or not the current panel is the last panel. | Boolean | undefined |
Methods
Method | Description | Parameters |
---|---|---|
| Sets the labels and tooltip content for the navigation buttons. |
|
toggleButtonStates | Toggles an element between an enabled/disabled state |
|
adjustCurrentPanelNum | Changes the current panel by a specified change amount. | toChange : A Number |
backButtonClicked | Moves the current panel back one position | |
nextButtonClicked | Moves the current panel forward one position |
Options
Name | Description | Values | Default |
---|---|---|---|
| The total number of panels that the buttons will be navigating through. |
| panelTotoalNum: null |
panelStartNum | The initial panel. This becomes the lower bound index for which panels can be indexed from. |
| panelStartNum: 1 |
| Javascript object containing selectors for various fragments of the markup, including the containers for the subcomponents. |
|
See Selectors |
styles | Specific class names used to achieve the look and feel. | { show: "gpii-fd-show" } | |
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 |
Selectors
One of the options that can be provided to the First Discovery Editor is a set of CSS-based selectors identifying where in the DOM different elements can be found. The value for the option is itself a Javascript object containing name/value pairs:
selectors: { selector1Name: "selector 1 string", selector2Name: "selector 2 string", ... }
Selector Name | Description | Default |
---|---|---|
| The back button. | "#gpiic-fd-navButtons-back" |
backLabel | The label for the back button. | ".gpiic-fd-navButtons-backLabel" |
next | The next button. | "#gpiic-fd-navButtons-next" |
nextLabel | The label for the next button. | ".gpiic-fd-navButtons-nextLabel" |
Dependencies
<script type="text/javascript" src="src/lib/infusion/infusion-custom.js"></script> <script type="text/javascript" src="src/js/tooltip.js"></script> <script type="text/javascript" src="src/js/msgLookup.js"></script> <script type="text/javascript" src="src/js/navButtons.js"></script>