API Docs for: 0.0.2
Show:

menu.Button Class

Extends Core
Module: language

Menu button arrow which you can apply to DOM Element to have a menu drop down below it.

Item Index

Methods

Events

Methods

cancelShow

()

This method should be called from function added as event handler to "beforeShow"

Example:

button.addEvent('beforeShow', function(button){ if(!this.isOkToShowButton()){ button.cancel(); } });

Attributes

alwaysVisible

Boolean default false

Button always visible. When false, it will be visible when mouse enters parent DOM element and hidden when it leaves it

Fires event alwaysVisibleChange

Fires when the value for the configuration attribute alwaysVisible is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

menu

View

Configuration object for the object to show on click on button

Default: undefined

Fires event menuChange

Fires when the value for the configuration attribute menu is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

region

String

Position button in this region. Valid values : 'nw','ne','sw' and 'se'

Default: 'ne'

Fires event regionChange

Fires when the value for the configuration attribute region is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

renderTo

String | DOMElement

Render button to this element

Default: undefined

Fires event renderToChange

Fires when the value for the configuration attribute renderTo is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

Events

beforeShow

Event fired before button is shown. You can use this event and call the cancel method if there are situations where you don't always want to show the button

Event Payload: