Alloy UI

aui-overlay  1.0.1

 
Filters

Class OverlayContext - extends OverlayBase

Known Subclasses:
Calendar ColorPicker OverlayContextPanel

A base class for OverlayContext, providing:
  • Widget Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)
  • Able to display an Overlay at a specified corner of an element trigger
Quick Example:
var instance = new A.OverlayContext({
boundingBox: '#OverlayBoundingBox',
hideOn: 'mouseleave',
showOn: 'mouseenter',
trigger: '.menu-trigger'
}).render();
Check the list of Configuration Attributes available for OverlayContext.

Constructor

OverlayContext ( config )
Parameters:
config <Object> Object literal specifying widget configuration properties.

Properties

OverlayContext.ATTRS - static Object

Static property used to define the default attribute configuration for the OverlayContext.

OverlayContext.NAME - static String

Static property provides a string to identify the class.

Properties inherited from WidgetStack:

Properties inherited from Attribute:

Properties inherited from Component:

Properties inherited from WidgetPositionAlign:

Properties inherited from Base:

Properties inherited from WidgetStdMod:

Properties inherited from WidgetPosition:

Properties inherited from WidgetPositionConstrain:

Configuration Attributes

align - Object

Inherited from Overlay.
Default Value: { node: null, points: [ TL, BL ] }

cancellableHide - boolean

Cancel auto hide delay if the user interact with the Overlay (focus, click, mouseover)
Default Value: true

currentNode - Node

OverlayContext allow multiple elements to be the trigger, the currentNode stores the current active one.
Default Value: First item of the trigger NodeList.

hideDelay - Number

Number of milliseconds after the hide method is invoked to hide the OverlayContext.
Default Value: 0

hideOn - String

The event which is responsible to hide the OverlayContext.
Default Value: mouseout

hideOnDocumentClick - boolean

If true the instance is registered on the OverlayContextManager static class and will be hide when the user click on document.
Default Value: true

showDelay - Number

Number of milliseconds after the show method is invoked to show the OverlayContext.
Default Value: 0

showOn - String

The event which is responsible to show the OverlayContext.
Default Value: mouseover

trigger - {Node | NodeList | String}

Node, NodeList or Selector which will be used as trigger elements to show or hide the OverlayContext.
Default Value: null

visible - boolean

If true the OverlayContext is visible by default after the render phase. Inherited from Overlay.
Default Value: false

Configuration attributes inherited from Widget:

Configuration attributes inherited from WidgetStack:

Configuration attributes inherited from Component:

Configuration attributes inherited from WidgetPositionAlign:

Configuration attributes inherited from Base:

Configuration attributes inherited from WidgetStdMod:

Configuration attributes inherited from WidgetPosition:

x,
xy,
y

Configuration attributes inherited from WidgetPositionConstrain:

Methods

_afterHideOnChange

protected void _afterHideOnChange ( event )
Fires after the hideOn attribute change.
Parameters:
event <EventFacade>

_afterShowOnChange

protected void _afterShowOnChange ( event )
Fires after the showOn attribute change.
Parameters:
event <EventFacade>

_afterTriggerChange

protected void _afterTriggerChange ( event )
Fires after the trigger attribute change.
Parameters:
event <EventFacade>

_beforeHideOnChange

protected void _beforeHideOnChange ( event )
Fires before the hideOn attribute change.
Parameters:
event <EventFacade>

_beforeShowOnChange

protected void _beforeShowOnChange ( event )
Fires before the showOn attribute change.
Parameters:
event <EventFacade>

_beforeTriggerChange

protected void _beforeTriggerChange ( event )
Fires before the trigger attribute change.
Parameters:
event <EventFacade>

_cancelAutoHide

protected void _cancelAutoHide ( event )
Cancel hide event if the user does some interaction with the OverlayContext (focus, click or mouseover).
Parameters:
event <EventFacade>

_invokeHideTaskOnInteraction

protected void _invokeHideTaskOnInteraction ( event )
Invoke the hide event when the OverlayContext looses the focus.
Parameters:
event <EventFacade>

_onVisibleChangeOverlayContext

protected void _onVisibleChangeOverlayContext ( event )
Fires when the visible attribute changes.
Parameters:
event <EventFacade>

_setHideOn

protected String _setHideOn ( eventType )
Setter for the hideOn attribute.
Parameters:
eventType <String> Event type

_setShowOn

protected String _setShowOn ( eventType )
Setter for the showOn attribute.
Parameters:
eventType <String> Event type

_stopTriggerEventPropagation

protected void _stopTriggerEventPropagation ( event )
Helper method to invoke event.stopPropagation().
Parameters:
event <EventFacade>

_toggle

protected void _toggle ( event )
Handles the logic for the toggle.
Parameters:
event <EventFacade>

bindUI

protected void bindUI ( )
Bind the events on the OverlayContext UI. Lifecycle.

clearIntervals

void clearIntervals ( )
Clear the intervals to show or hide the OverlayContext. See hideDelay and showDelay.

hide

void hide ( )
Hides the OverlayContext.

refreshAlign

void refreshAlign ( )
Refreshes the alignment of the OverlayContext with the currentNode. See also align.

toggle

void toggle ( event )
Toggles visibility of the OverlayContext.
Parameters:
event <EventFacade>

updateCurrentNode

void updateCurrentNode ( event )
Update the currentNode with the align node or the event.currentTarget and in last case with the first item of the trigger.
Parameters:
event <EventFacade>

Methods inherited from Plugin.Host:

Events

alignChange

alignChange ( event )
Fires when the value for the configuration attribute 'align' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

cancellableHideChange

cancellableHideChange ( event )
Fires when the value for the configuration attribute 'cancellableHide' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

currentNodeChange

currentNodeChange ( event )
Fires when the value for the configuration attribute 'currentNode' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

hideDelayChange

hideDelayChange ( event )
Fires when the value for the configuration attribute 'hideDelay' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

hideOnChange

hideOnChange ( event )
Fires when the value for the configuration attribute 'hideOn' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

hideOnDocumentClickChange

hideOnDocumentClickChange ( event )
Fires when the value for the configuration attribute 'hideOnDocumentClick' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

showDelayChange

showDelayChange ( event )
Fires when the value for the configuration attribute 'showDelay' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

showOnChange

showOnChange ( event )
Fires when the value for the configuration attribute 'showOn' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

triggerChange

triggerChange ( event )
Fires when the value for the configuration attribute 'trigger' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

visibleChange

visibleChange ( event )
Fires when the value for the configuration attribute 'visible' 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:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

Events inherited from WidgetStack:

Events inherited from Base:

Events inherited from WidgetPosition: