OverlayMask Class
A base class for OverlayMask, providing: <ul> <li>Widget Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)</li> <li>Cross browser mask functionality to cover an element or the entire page</li> <li>Customizable mask (i.e., background, opacity)</li> </ul>
Quick Example:<br/>
<pre><code>var instance = new A.OverlayMask().render();</code></pre>
Check the list of <a href="OverlayMask.html#configattributes">Configuration Attributes</a> available for OverlayMask.
Constructor
OverlayMask
-
config
Parameters:
-
config
ObjectObject literal specifying widget configuration properties.
Index
Methods
- _addShimResizeHandlers
- _addStdModContent
- _afterAlignChange
- _afterAlignOnChange
- _afterBodyChange
- _afterConstrainChange
- _afterFillHeightChange
- _afterFooterChange
- _afterHeaderChange
- _afterShimChange
- _afterTargetChange
- _afterVisibleChange
- _afterXYChange
- _afterZIndexChange
- _applyStdModParsedConfig
- _attachPosAlignUIHandles
- _bindUIPosAlign
- _bindUIPosConstrained
- _bindUIPosition
- _bindUIStack
- _bindUIStdMod
- _constrain
- _constrainOnXYChange
- _destroyShim
- _detachPosAlignUIHandles
- _detachStackHandles
- _doAlign
- _enableConstraints
- _eraseStdMod
- _fillHeight
- _findStdModSection
- _getAlignedXY
- _getAlignToXY
- _getPreciseHeight
- _getRegion
- _getShimTemplate
- _getStdModContent
- _getStdModTemplate
- _getX
- _getY
- _insertStdModSection
- _parseStdModHTML
- _parseZIndex
- _preventOverlap
- _renderShim
- _renderShimDeferred
- _renderStdMod
- _renderUIPosition
- _renderUIStack
- _renderUIStdMod
- _setAlignCenter
- _setConstrain
- _setOpacity
- _setX
- _setY
- _setZIndex
- _syncUIPosAlign
- _syncUIPosition
- _syncUIStack
- _syncUIStdMod
- _uiSetAlign
- _uiSetFillHeight
- _uiSetShim
- _uiSetStdMod
- _uiSetVisible
- _uiSetVisiblePosAlign
- _uiSetXY
- _uiSetZIndex
- _validateFillHeight
- _validateXY
- align
- bindUI
- centered
- constrain
- fillHeight
- getConstrainedXY
- getStdModNode
- getTargetSize
- move
- refreshMask
- setStdModContent
- sizeShim
- syncUI
- syncXY
Properties
- _posAlignUIHandles
- OverlayMask.ATTRS static
- OverlayMask.NAME static
Methods
_addShimResizeHandlers
()
private
Sets up event listeners to resize the shim when the size of the Widget changes. <p> NOTE: This method is only used for IE6 currently, since IE6 doesn't support a way to resize the shim purely through CSS, when the Widget does not have an explicit width/height set. </p>
_addStdModContent
-
node
-
children
-
where
Helper method to add content to a StdMod section node. The content is added either before, after or replaces the existing node content based on the value of the <code>where</code> argument.
Parameters:
-
node
Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The section Node to be updated.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
children
Node | NodeList | String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The new content Node, NodeList or String to be added to section Node provided.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
where
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE. If not provided, the content will replace existing content in the Node.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_afterAlignChange
-
e
Handles alignChange
events by updating the UI in response to align
Attribute changes.
Parameters:
_afterAlignOnChange
-
e
Handles alignOnChange
events by updating the alignment-syncing event
handlers.
Parameters:
_afterBodyChange
-
e
Default attribute change listener for the bodyContent attribute, responsible for updating the UI, in response to attribute changes.
Parameters:
-
e
EventFacade<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The event facade for the attribute change</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_afterConstrainChange
-
e
After change listener for the "constrain" attribute, responsible for updating the UI, in response to attribute changes.
Parameters:
-
e
EventFacade<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The event facade</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_afterFillHeightChange
-
e
Default attribute change listener for the fillHeight attribute, responsible for updating the UI, in response to attribute changes.
Parameters:
-
e
EventFacade<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The event facade for the attribute change</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_afterHeaderChange
-
e
Default attribute change listener for the headerContent attribute, responsible for updating the UI, in response to attribute changes.
Parameters:
-
e
EventFacade<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The event facade for the attribute change</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_afterShimChange
-
e
Default attribute change listener for the shim attribute, responsible for updating the UI, in response to attribute changes.
Parameters:
-
e
EventFacade<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The event facade for the attribute change</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_afterTargetChange
-
event
Fires after the value of the <a href="Paginator.html#config_target">target</a> attribute change.
Parameters:
-
event
EventFacade
_afterVisibleChange
-
event
Fires after the value of the <a href="Paginator.html#config_visible">visible</a> attribute change.
Parameters:
-
event
EventFacade
_afterXYChange
-
e
Default attribute change listener for the xy attribute, responsible for updating the UI, in response to attribute changes.
Parameters:
-
e
EventFacade<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The event facade for the attribute change</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_afterZIndexChange
-
e
Default attribute change listener for the zIndex attribute, responsible for updating the UI, in response to attribute changes.
Parameters:
-
e
EventFacade<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The event facade for the attribute change</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_applyStdModParsedConfig
()
private
This method is injected before the _applyParsedConfig step in the application of HTML_PARSER, and sets up the state to identify whether or not we should remove the current DOM content or not, based on whether or not the current content attribute value was extracted from the DOM, or provided by the user configuration
_attachPosAlignUIHandles
()
protected
Attaches the alignment-syncing event handlers.
_bindUIPosAlign
()
protected
Bind event listeners responsible for updating the UI state in response to the widget's position-align related state changes.
This method is invoked after bindUI
has been invoked for the Widget
class using the AOP infrastructure.
_bindUIPosConstrained
()
protected
Binds event listeners responsible for updating the UI state in response to Widget constrained positioning related state changes. <p> This method is invoked after bindUI is invoked for the Widget class using YUI's aop infrastructure. </p>
_bindUIPosition
()
protected
Binds event listeners responsible for updating the UI state in response to Widget position related state changes. <p> This method in invoked after bindUI is invoked for the Widget class using YUI's aop infrastructure. </p>
_bindUIStack
()
protected
Binds event listeners responsible for updating the UI state in response to Widget stack related state changes. <p> This method is invoked after bindUI is invoked for the Widget class using YUI's aop infrastructure. </p>
_bindUIStdMod
()
protected
Binds event listeners responsible for updating the UI state in response to Widget standard module related state changes. <p> This method is invoked after bindUI is invoked for the Widget class using YUI's aop infrastructure. </p>
_constrain
-
val
-
axis
-
nodeRegion
-
constrainingRegion
The method which performs the actual constrain calculations for a given axis ("x" or "y") based on the regions provided.
Parameters:
-
val
Number<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The value to constrain</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
axis
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The axis to use for constrainment</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
nodeRegion
Region<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The region of the node to constrain</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
constrainingRegion
Region<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The region of the node (or viewport) to constrain to</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The constrained value</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_constrainOnXYChange
-
e
The on change listener for the "xy" attribute. Modifies the event facade's newVal property with the constrained XY value.
Parameters:
-
e
EventFacade<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The event facade for the attribute change</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_destroyShim
()
private
Removes the shim from the DOM, and detaches any related event listeners.
_detachPosAlignUIHandles
()
protected
Detaches the alignment-syncing event handlers.
_detachStackHandles
-
String
Detaches any handles stored for the provided key
Parameters:
-
String
Object<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>handleKey The key defining the group of handles which should be detached</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_doAlign
-
xy
Helper method, used to align the given point on the widget, with the XY page coordinates provided.
Parameters:
-
xy
Array<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>XY page coordinates to align to.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_enableConstraints
-
enable
Updates the UI if enabling constraints, and sets up the xyChange event listeners to constrain whenever the widget is moved. Disabling constraints removes the listeners.
Parameters:
-
enable
Boolean<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Enable or disable constraints</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_eraseStdMod
-
section
Removes the DOM node for the given section.
Parameters:
-
section
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The section to remove. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_fillHeight
()
private
Updates the rendered UI, to resize the current section specified by the fillHeight attribute, so that the standard module fills out the Widget height. If a height has not been set on Widget, the section is not resized (height is set to "auto").
_findStdModSection
-
section
Helper method to to find the rendered node for the given section, if it exists.
Parameters:
-
section
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The section for which the render Node is to be found. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The rendered node for the given section, or null if not found.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_getAlignedXY
-
[node]
-
points
Returns Widget
alignment coordinates realative to the given Node
.
Parameters:
-
[node]
Node | String | Null optional<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node to align to, or null to indicate the viewport.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
points
Array<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The alignment points.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>the coordinates.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_getAlignToXY
-
'Node'
-
[point]
-
'Node'
-
'Node'
Returns coordinates realative to the passed Node
alignment.
Parameters:
-
'Node'
Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node to align to.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
[point]
Array optional<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node alignment points.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
'Node'
Number<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>x coordinate.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
'Node'
Number<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>y coordinate.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>the coordinates.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_getPreciseHeight
-
node
Helper method to obtain the precise height of the node provided, including padding and border. The height could be a sub-pixel value for certain browsers, such as Firefox 3.
Parameters:
-
node
Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node for which the precise height is required.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The height of the Node including borders and padding, possibly a float.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_getRegion
-
[node]
Returns the region of the passed-in Node
, or the viewport region if
calling with passing in a Node
.
Parameters:
-
[node]
Node optional<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node to get the region of.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node's region.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_getShimTemplate
()
Node
private
Creates a cloned shim node, using the SHIM_TEMPLATE html template, for use on a new instance.
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>node A new shim Node instance.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_getStdModContent
-
section
Retrieves the child nodes (content) of a standard module section
Parameters:
-
section
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The standard module section whose child nodes are to be retrieved. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The child node collection of the standard module section.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_getStdModTemplate
-
section
Gets a new Node reference for the given standard module section, by cloning the stored template node.
Parameters:
-
section
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The section to create a new node for. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The new Node instance for the section</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_getX
()
Number
protected
Default getter for the X attribute. The value is retrieved from the XY attribute, which is the sole store for the XY state.
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The X page co-ordinate value</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_getY
()
Number
protected
Default getter for the Y attribute. The value is retrieved from the XY attribute, which is the sole store for the XY state.
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The Y page co-ordinate value</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_insertStdModSection
-
contentBox
-
section
-
sectionNode
Helper method to insert the Node for the given section into the correct location in the contentBox.
Parameters:
-
contentBox
Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>A reference to the Widgets content box.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
section
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The section to create/render. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
sectionNode
Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The Node for the section.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_parseStdModHTML
-
section
Utility method, used by WidgetStdMods HTML_PARSER implementation to extract data for each section from markup.
Parameters:
-
section
String
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Inner HTML string with the contents of the section</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_parseZIndex
-
srcNode
Parses a zIndex
attribute value from this widget's srcNode
.
Parameters:
-
srcNode
Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node to parse a <code>zIndex</code> value from.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The parsed <code>zIndex</code> value.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_preventOverlap
-
val
-
axis
-
nodeRegion
-
constrainingRegion
The method which performs the preventOverlap calculations for a given axis ("x" or "y") based on the value and regions provided.
Parameters:
-
val
Number<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The value being constrain</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
axis
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The axis to being constrained</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
nodeRegion
Region<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The region of the node being constrained</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
constrainingRegion
Region<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The region of the node (or viewport) we need to constrain to</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The constrained value</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_renderShim
()
private
Creates the shim element and adds it to the DOM
_renderShimDeferred
()
private
Sets up change handlers for the visible attribute, to defer shim creation/rendering until the Widget is made visible.
_renderStdMod
-
section
Creates the DOM node for the given section, and inserts it into the correct location in the contentBox.
Parameters:
-
section
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The section to create/render. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>A reference to the added section node</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_renderUIPosition
()
protected
Creates/Initializes the DOM to support xy page positioning. <p> This method in invoked after renderUI is invoked for the Widget class using YUI's aop infrastructure. </p>
_renderUIStack
()
protected
Creates/Initializes the DOM to support stackability. <p> This method in invoked after renderUI is invoked for the Widget class using YUI's aop infrastructure. </p>
_renderUIStdMod
()
protected
Creates/Initializes the DOM for standard module support. <p> This method is invoked after renderUI is invoked for the Widget class using YUI's aop infrastructure. </p>
_setAlignCenter
-
val
Default setter for center
Attribute changes. Sets up the appropriate
value, and passes it through the to the align attribute.
Parameters:
-
val
Boolean | Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The Attribute value being set.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>the value passed in.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_setConstrain
-
val
The setter implementation for the "constrain" attribute.
Parameters:
-
val
Node | boolean<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The attribute value</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_setOpacity
-
v
Setter for <a href="Paginator.html#config_opacity">opacity</a>.
Parameters:
-
v
Number
Returns:
_setX
-
val
Default setter for the X attribute. The setter passes the X value through to the XY attribute, which is the sole store for the XY state.
Parameters:
-
val
Number<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The X page co-ordinate value</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_setY
-
val
Default setter for the Y attribute. The setter passes the Y value through to the XY attribute, which is the sole store for the XY state.
Parameters:
-
val
Number<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The Y page co-ordinate value</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_setZIndex
-
zIndex
Default setter for zIndex attribute changes. Normalizes zIndex values to numbers, converting non-numerical values to 0.
Parameters:
-
zIndex
String | Number
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Normalized zIndex</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_syncUIPosAlign
()
protected
Synchronizes the current align
Attribute value to the DOM.
This method is invoked after syncUI
has been invoked for the Widget
class using the AOP infrastructure.
_syncUIPosition
()
protected
Synchronizes the UI to match the Widgets xy page position state. <p> This method in invoked after syncUI is invoked for the Widget class using YUI's aop infrastructure. </p>
_syncUIStack
()
protected
Synchronizes the UI to match the Widgets stack state. This method in invoked after syncUI is invoked for the Widget class using YUI's aop infrastructure.
_syncUIStdMod
()
protected
Synchronizes the UI to match the Widgets standard module state. <p> This method is invoked after syncUI is invoked for the Widget class using YUI's aop infrastructure. </p>
_uiSetAlign
-
[node]
-
points
Updates the UI to reflect the align
value passed in.
Note: See the align
Attribute documentation, for the Object structure
expected.
Parameters:
-
[node]
Node | String | Null optional<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node to align to, or null to indicate the viewport.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
points
Array<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The alignment points.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_uiSetFillHeight
-
fillSection
Updates the rendered UI, to resize the provided section so that the standard module fills out the specified widget height. Note: This method does not check whether or not a height is set on the Widget.
Parameters:
-
fillSection
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>A valid section specifier - one of WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_uiSetShim
-
enable
Updates the UI to enable/disable the shim. If the widget is not currently visible, creation of the shim is deferred until it is made visible, for performance reasons.
Parameters:
-
enable
Boolean<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>If true, creates/renders the shim, if false, removes it.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_uiSetStdMod
-
section
-
content
-
where
Updates the rendered UI, adding the provided content (either an HTML string, or node reference), to the specified section. The content is either added before, after or replaces existing content in the section, based on the value of the <code>where</code> argument.
Parameters:
-
section
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The section to be updated. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
content
String | Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The new content (either as an HTML string, or Node reference) to add to the section</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
where
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE. If not provided, the content will replace existing content in the section.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_uiSetVisible
-
val
Invoke the <code>OverlayMask.superclass._uiSetVisible</code>. Used to reset the <code>opacity</code> to work around IE bugs when set opacity of hidden elements.
Parameters:
-
val
Boolean
_uiSetVisiblePosAlign
-
visible
Attaches or detaches alignment-syncing event handlers based on the widget's
visible
Attribute state.
Parameters:
-
visible
Boolean<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The current value of the widget's <code>visible</code> Attribute.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_uiSetXY
-
event
UI Setter for the <a href="Paginator.html#config_xy">XY</a> attribute.
Parameters:
-
event
EventFacade
_uiSetZIndex
-
zIndex
Updates the UI to reflect the zIndex value passed in.
Parameters:
-
zIndex
Number<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The zindex to be reflected in the UI</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_validateFillHeight
-
val
Default validator for the fillHeight attribute. Verifies that the value set is a valid section specifier - one of WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER, or a falsey value if fillHeight is to be disabled.
Parameters:
-
val
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The section which should be setup to fill height, or false/null to disable fillHeight</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>true if valid, false if not</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
_validateXY
-
val
Default validator for the XY attribute
Parameters:
-
val
Array<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The XY page co-ordinate value which is being set.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>true if valid, false if not.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
align
-
[node]
-
[points]
Aligns this widget to the provided Node
(or viewport) using the provided
points. This method can be invoked with no arguments which will cause the
widget's current align
Attribute value to be synced to the DOM.
Parameters:
-
[node]
Node | String | Null optional<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>A reference (or selector String) for the <code>Node</code> which with the widget is to be aligned. If null is passed in, the widget will be aligned with the viewport.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
[points]
Array2 optional<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>A two item array specifying the points on the widget and <code>Node</code>/viewport which will to be aligned. The first entry is the point on the widget, and the second entry is the point on the <code>Node</code>/viewport. Valid point references are defined as static constants on the <code>WidgetPositionAlign</code> extension.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Example:
Aligning to the top-left corner of the <body>
:
myWidget.align('body',
[Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.TR]);
bindUI
()
protected
Bind the events on the OverlayMask UI. Lifecycle.
centered
-
[node]
Centers the widget in the viewport, or if a Node
is passed in, it will
be centered to that Node
.
Parameters:
-
[node]
Node | String optional<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>A <code>Node</code> reference or selector String defining the <code>Node</code> which the widget should be centered. If a <code>Node</code> is not passed in, then the widget will be centered to the viewport.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
constrain
-
xy
-
node
Constrains the widget's bounding box to a node (or the viewport). If xy or node are not passed in, the current position and the value of "constrain" will be used respectively.
The widget's position will be changed to the constrained position.
Parameters:
-
xy
Array<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Optional. The xy values to constrain</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
node
Node | boolean<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Optional. The node to constrain to, or true for the viewport</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
fillHeight
-
node
Sets the height on the provided header, body or footer element to fill out the height of the Widget. It determines the height of the widgets bounding box, based on it's configured height value, and sets the height of the provided section to fill out any space remaining after the other standard module section heights have been accounted for.
<p><strong>NOTE:</strong> This method is not designed to work if an explicit height has not been set on the Widget, since for an "auto" height Widget, the heights of the header/body/footer will drive the height of the Widget.</p>
Parameters:
-
node
Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node which should be resized to fill out the height of the Widget bounding box. Should be a standard module section node which belongs to the widget.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
getConstrainedXY
-
xy
-
node
Calculates the constrained positions for the XY positions provided, using the provided node argument is passed in. If no node value is passed in, the value of the "constrain" attribute is used.
Parameters:
-
xy
Array<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The xy values to constrain</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
node
Node | boolean<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Optional. The node to constrain to, or true for the viewport</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The constrained xy values</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
getStdModNode
-
section
-
forceCreate
Returns the node reference for the specified section
.
Note: The DOM is not queried for the node reference. The reference
stored by the widget instance is returned if it was set. Passing a
truthy for forceCreate
will create the section node if it does not
already exist.
Parameters:
-
section
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The section whose node reference is required. Either <code>WidgetStdMod.HEADER</code>, <code>WidgetStdMod.BODY</code>, or <code>WidgetStdMod.FOOTER</code>.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
forceCreate
Boolean<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Whether the section node should be created if it does not already exist.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
Returns:
<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The node reference for the <code>section</code>, or null if not set.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
getTargetSize
()
Object
Get the size of the <a href="OverlayMask.html#config_target">target</a>. Used to dimension the mask node.
Returns:
Object containing the { height: height, width: width }.
move
-
x
-
[y]
Moves the Widget to the specified page xy co-ordinate position.
Parameters:
-
x
Number | Number[]<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The new x position or [x, y] values passed as an array to support simple pass through of Node.getXY results</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
[y]
Number optional<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The new y position</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
refreshMask
()
Repaint the OverlayMask UI, respecting the <a href="OverlayMask.html#config_target">target</a> size and the <a href="OverlayMask.html#config_alignPoints">alignPoints</a>.
setStdModContent
-
section
-
content
-
where
Updates the body section of the standard module with the content provided (either an HTML string, or node reference). <p> This method can be used instead of the corresponding section content attribute if you'd like to retain the current content of the section, and insert content before or after it, by specifying the <code>where</code> argument. </p>
Parameters:
-
section
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The standard module section whose content is to be updated. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
content
String | Node<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The content to be added, either an HTML string or a Node reference.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
-
where
String<p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE. If not provided, the content will replace existing content in the section.</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>
sizeShim
()
For IE6, synchronizes the size and position of iframe shim to that of Widget bounding box which it is protecting. For all other browsers, this method does not do anything.
syncUI
()
protected
Sync the OverlayMask UI. Lifecycle.
syncXY
()
Synchronizes the Panel's "xy", "x", and "y" properties with the Widget's position in the DOM.
Properties
_posAlignUIHandles
Array
protected
Holds the alignment-syncing event handles.
Default: null
OverlayMask.ATTRS
Object
static
Static property used to define the default attribute configuration for the OverlayMask.
OverlayMask.NAME
String
static
Static property provides a string to identify the class.
Attributes
align
Object
The alignment configuration for this widget.
The align
attribute is used to align a reference point on the widget, with
the reference point on another Node
, or the viewport. The object which
align
expects has the following properties:
-
__
node
__: TheNode
to which the widget is to be aligned. If set tonull
, or not provided, the widget is aligned to the viewport. -
__
points
__: A two element Array, defining the two points on the widget andNode
/viewport which are to be aligned. The first element is the point on the widget, and the second element is the point on theNode
/viewport. Supported alignment points are defined as static properties onWidgetPositionAlign
.
Default: null
Example:
Aligns the top-right corner of the widget with the top-left corner of the viewport:
myWidget.set('align', {
points: [Y.WidgetPositionAlign.TR, Y.WidgetPositionAlign.TL]
});
alignOn
Array
An Array of Objects corresponding to the Node
s and events that will cause
the alignment of this widget to be synced to the DOM.
The alignOn
Attribute is expected to be an Array of Objects with the
following properties:
-
__
eventName
__: The String event name to listen for. -
__
node
__: The optionalNode
that will fire the event, it can be aNode
reference or a selector String. This will default to the widget'sboundingBox
.
Default: []
Example:
Sync this widget's alignment on window resize:
myWidget.set('alignOn', [
{
node : Y.one('win'),
eventName: 'resize'
}
]);
alignPoints
Array
Points to align the <a href="Overlay.html">Overlay</a> used as mask.
Default: [ 'tl', 'tl' ]
bodyContent
HTML
The content to be added to the body section. This will replace any existing content in the body. If you want to append, or insert new content, use the <a href="#method_setStdModContent">setStdModContent</a> method.
Default: undefined
centered
Boolean | Node
A convenience Attribute, which can be used as a shortcut for the align
Attribute.
If set to true
, the widget is centered in the viewport. If set to a Node
reference or valid selector String, the widget will be centered within the
Node
. If set to false
, no center positioning is applied.
Default: false
constrain
Boolean | Node
The node to constrain the widget's bounding box to, when setting xy. Can also be set to true, to constrain to the viewport.
Default: null
fillHeight
String
The section (WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER) which should be resized to fill the height of the standard module, when a height is set on the Widget. If a height is not set on the widget, then all sections are sized based on their content.
Default: WidgetStdMod.BODY
headerContent
HTML
The content to be added to the header section. This will replace any existing content in the header. If you want to append, or insert new content, use the <a href="#method_setStdModContent">setStdModContent</a> method.
Default: undefined
preventOverlap
Boolean
If set to true, and WidgetPositionAlign is also added to the Widget, constrained positioning will attempt to prevent the widget's bounding box from overlapping the element to which it has been aligned, by flipping the orientation of the alignment for corner based alignments
target
Node | String
Node where the mask will be positioned and re-dimensioned. The default is the document, which means that if not specified the mask takes the full screen.
Default: document
visible
Boolean
If true the Overlay is visible by default after the render phase. Inherited from <a href="Overlay.html">Overlay</a>.
Default: false
x
Number
Page X co-ordinate for the widget. This attribute acts as a facade for the xy attribute. Changes in position can be monitored by listening for xyChange events.
Default: 0
y
Number
Page Y co-ordinate for the widget. This attribute acts as a facade for the xy attribute. Changes in position can be monitored by listening for xyChange events.
Default: 0