This page is a work in progress.
ButtonService
ButtonService is an Angular Factory in the Widget module with the name button.js
. It provides an API to create buttons, toggles, and radio button sets. To use these functions, see the documentation on injecting Angular services.
Name | Summary |
---|---|
button | Creates a button. |
toggle | Creates a toggle. |
radioSet | Creates a radio button set. |
Function Descriptions
button
Creates a button – an element that executes a function when clicked.
Example Usage | Arguments | Return Value |
---|---|---|
bns.button(div , id , gid , cb , tooltip ); |
| creates a button with the given information returns an object with an API: id - the string with the button ID width - function that computes the width of the button plus padding in pixels as a number |
An example of a button is the Reset pan / zoom button on the Topology View.
When clicked, the pan and zoom of the Topology View is reset to the default. This is an example of an "execute once" type of function, which is what buttons are for. Also shown is the tooltip.
toggle
Creates a toggle – an element that has state (selected or unselected) that executes a function on click.
Example Usage | Arguments | Return Value |
---|---|---|
bns.toggle(div , id , gid , initState , cb , tooltip ); |
| creates a toggle with the given information returns an object with an API: id - the string with the button ID width - function that computes the width of the toggle plus padding in pixels as a number selected - function that returns whether the toggle is currently selected – true for selected, false for unselected ... more to come |
radioSet
Creates a radio button set – set of one or more elements that have state (one is active at a time) that executes a function when one is clicked.