Class: menubar

menubar

The MenuBar - this is a singleton
Source:

Methods

createButton(accesskey, imageClass, name, action, insertBefore, hint, insertIntoopt, iconClassopt) → {object}

Create a button for the menubar
Parameters:
Name Type Attributes Default Description
accesskey object | string the access key code or object with { keycode: {string}, shift: {boolean} }
imageClass string CSS class for the image to use and also the ID (not twice!)
name string Title of the button
action function function to execute when pressed or touch ended
insertBefore object DOM Object to insert the new button before
hint string what the button is about
insertInto object <optional>
'#__menuBar' Where to add the button.
iconClass string <optional>
'__icon' CSS Class to add for an icon to be shown
Source:
Returns:
the Button
Type
object

createDropDown(name, values, action, defaultValue, insertInto, className) → {object}

Create a dropdown box
Parameters:
Name Type Description
name string Name and ID of the box
values Array List of values
action function The action to call for a selected value
defaultValue string The default value from the list
insertInto object Which button to replace with the dropdown
className string Extra class names for the dropdown
Source:
Returns:
The dropdown element
Type
object

createGroup(insertBeforeopt) → {object}

Create a group where, e.g. buttons can be added
Parameters:
Name Type Attributes Default Description
insertBefore object <optional>
null DOM element to insert the group before - at the end if null
Source:
Returns:
DOM element of the group
Type
object

createSpacer(insertBeforeopt) → {object}

Create a spacer with the size of a button
Parameters:
Name Type Attributes Default Description
insertBefore object <optional>
null DOM element to insert the group before - at the end if null
Source:
Returns:
DOM element of the group
Type
object

init()

Set up the initial state of the menubar and create the buttons
Source: