A5ControlBar Class
Arguments
- containerIdstring
The ID of the element the control bar should be rendered in.
- settingsobject
Settings for the control bar. This will override the initial values of the properties of the A5.ControlBar class.
Description
Control bar.
- Name
- Description
- A5.ControlBar.Action Data Object
The data passed to an action when the action is being fired from an item in the layout.
- A5.ControlBar.Animation Object
Definition of a redraw animation in the control bar.
- A5.ControlBar.Disclosure Object
Definition of a named disclosure.
- A5.ControlBar.Item Button List Object
Definition of a button list.
- A5.ControlBar.Item Button Toggle Object
Definition of a toggle button.
- A5.ControlBar.Item Button Object
Definition of a button.
- A5.ControlBar.Item Disclosure Button Object
Definition of a disclosure button.
- A5.ControlBar.Item Edit Object
Definition of an edit.
- A5.ControlBar.Item HTML Object
Definition of static HTML item.
- A5.ControlBar.Layout Line Object
Definition of a line in a layout in the control bar.
- A5.ControlBar.Layout Object
Definition of a layout in the control bar.
Properties
- themestring
The theme to use on the control bar.
- overridestring
The overrides to use on the control bar.
- edgestring
The "edge" the control bar considers outside. The options are "top" (the default), "bottom", "left" and "right". Lines of the layout are laid out away from this edge. For example in a "top" edge layout, the second line would be below the first. However, on a "bottom" edge layout, the second line would be above the first.
- topClassNamestring
The class name to put on the control bar layout (main or disclosure) when the edge is "top".
- bottomClassNamestring
The class name to put on the control bar layout (main or disclosure) when the edge is "bottom".
- leftClassNamestring
The class name to put on the control bar layout (main or disclosure) when the edge is "left".
- rightClassNamestring
The class name to put on the control bar layout (main or disclosure) when the edge is "right".
- separatorobject
Separator settings.
- horizontalClassNamestring
The class name to apply to a horizontal separator.
- verticalClassNamestring
The class name to apply to a vertical separator.
- itemsobject
The definition of named items to be used in layouts. Each property in this object will be then name of the item, and must be one of these obejcts: A5.ControlBar Item HTML Object, A5.ControlBar Item Button Object, A5.ControlBar Item Button Toggle Object, A5.ControlBar Item Button List Object or A5.ControlBar Item Disclosure Button Object.
- actionsobject
The definition of named actions to be used by items, or programmatically via the A5.ControlBar.action method. Each property in this object will be then name of the action, and must be a function. The function will be called with a data argument. The argument is either passed in by the A5.ControlBar.action method, or dynamically created by the item when the user interacts with. See A5.ControlBar Action Data Object.
- layoutstringfunction
If a string the name of the layout to use. If a function then the function should return the name of the layout to use, and will be called every time the control bar is refreshed.
- layoutsobject
The definition of named layouts to use in the A5.ControlBar. See A5.ControlBar Layout Object.
- disclosureobject
Disclosure settings.
- containerstring
The ID of the element to place the disclosures in. By default the disclosures will be placed in the top level BODY of the document.
- animationobject
Disclosure animation settings.
- durationnumber
The number of milliseconds a disclosure should take to animate in or out.
- tweenstring
The CSS "tween" for a disclosure animation. The default is "ease-in-out".
- coverClassNamestring
The class name to put on the element that covers the screen while the disclosure is up. This can be used to "grey out" the background.
- coverobject
Disclosure settings for when the disclosure is shown as "cover".
- topClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the top edge.
- bottomClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the bottom edge.
- leftClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the left edge.
- rightClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the right edge.
- extendobject
Disclosure settings for when the disclosure is shown as "extend".
- topClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the top edge.
- bottomClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the bottom edge.
- leftClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the left edge.
- rightClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the right edge.
- expandobject
Disclosure settings for when the disclosure is shown as "expand".
- topClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the top edge.
- bottomClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the bottom edge.
- leftClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the left edge.
- rightClassNamestring
The class name to put on the element that clips the disclosure when the disclosure is shown from the right edge.
- defaultsobject
Disclosure default settings.
- classNamestring
The class name to put on the disclosure element.
- disclosuresobject
The definition of named disclosures. See A5.ControlBar Disclosure Object.
- stateobject
The state information for the control bar.
- layoutstring
The name of the current layout shown in the control bar.
- disclosureobject
State information for the disclosure.
- shownboolean
Whether or not a disclosure is shown.
- namestring
The name of the currently shown disclosure. If the disclosure being shown is a layout, the name will be the layout name prefixed with "layout:".
- typestring
The show type of the disclosure.
- edgestring
The edge the disclosure is shown from. The value will be either "top", "left", "right" or "bottom".
- onBeforePopulatefunction(data)
Event fired before the control bar is populated. If a value of false is returned by the function the populate will not be done.
- dataobject
The data to populate the control bar with.
- onPopulatefunction(data)
Event fired when the control bar is populated.
- dataobject
The data the control bar was populated with.
- onBeforeDrawfunction(path)
Event fired before the a layout in the control bar is drawn.
- pathstring
The part of the control bar the layout is being drawn in. Values can be either "main" or "disclosure".
- onDrawfunction(path,element)
Event fired when a layout in the control bar is drawn.
- pathstring
The part of the control bar the layout was drawn in. Values can be either "main" or "disclosure".
- elementobject
The DOM element of the part of the control bar the layout was drawn in.
- onChangefunction(paths,values)
Event fired when a value in the data is changed, either by user interaction with an item or by the A5.ControlBar.update method.
- pathsarray
An array of all the paths in the data that have been changed.
- valuesarray
An array of all the values corresponding to the paths in the data that have been changed.
Methods
- action Method
Programmatically fire an action of the control bar.
- destroy Method
Destroy the control bar. This method should be called before the control bar is removed from the DOM.
- focus Method
Programmatically focus on an item in the control bar. In the case of an edit item, the item will be put into edit mode.
- hideDisclosure Method
Hide the currently shown disclosure.
- initializeItems Method
Initialize items in the control bar. This is automatically called when the control bar is created. If item definitions are changed after creation, A5.ControlBar.initializeItems must be called in order for the changes to take effect.
- populate Method
Populate the control bar with new data.
- refresh Method
Refresh the control bar.
- resizeDisclosure Method
Resize the currently shown disclosure.
- setLayout Method
Change the layout to the layout passed in.
- showDisclosure Method
Show a disclosure.
- update Method
Update values in the data. A single path and value may be passed in, or an array of paths and values.