Show:

A basic Overlay Widget, which can be positioned based on Page XY co-ordinates and is stackable (z-index support). It also provides alignment and centering support and uses a standard module format for it's content, with header, body and footer section support.

Constructor

OverlayBase

(
  • object
)

Parameters:

  • object Object

    The user configuration for the instance.

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
)
private

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>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>

  • children Node | NodeList | String

    <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>

  • where String

    <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>

_afterAlignChange

(
  • e
)
protected

Handles alignChange events by updating the UI in response to align Attribute changes.

Parameters:

_afterAlignOnChange

(
  • e
)
protected

Handles alignOnChange events by updating the alignment-syncing event handlers.

Parameters:

_afterBodyChange

(
  • e
)
protected

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>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>

_afterConstrainChange

(
  • e
)
protected

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>The event facade</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>

_afterFillHeightChange

(
  • e
)
protected

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>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>

_afterFooterChange

(
  • e
)
protected

Default attribute change listener for the footerContent 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>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>

_afterHeaderChange

(
  • e
)
protected

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>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>

_afterShimChange

(
  • e
)
protected

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>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>

_afterXYChange

(
  • e
)
protected

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>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>

_afterZIndexChange

(
  • e
)
protected

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>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>

_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
)
Number protected

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>The value to constrain</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>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>

  • nodeRegion Region

    <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>

  • constrainingRegion Region

    <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>

Returns:

Number:

<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>

_constrainOnXYChange

(
  • e
)
protected

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>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>

_destroyShim

() private

Removes the shim from the DOM, and detaches any related event listeners.

_detachPosAlignUIHandles

() protected

Detaches the alignment-syncing event handlers.

_detachStackHandles

(
  • String
)
private

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>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>

_doAlign

(
  • xy
)
private

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>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>

_enableConstraints

(
  • enable
)
private

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>Enable or disable constraints</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>

_eraseStdMod

(
  • section
)
protected

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>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>

_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
)
Node private

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>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>

Returns:

Node:

<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>

_getAlignedXY

(
  • [node]
  • points
)
Array protected

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>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>

  • points Array

    <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>

Returns:

Array:

<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>

_getAlignToXY

(
  • 'Node'
  • [point]
  • 'Node'
  • 'Node'
)
Array private

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>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>

  • [point] Array optional

    <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>

  • 'Node' Number

    <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>

  • 'Node' Number

    <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>

Returns:

Array:

<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>

_getPreciseHeight

(
  • node
)
Number private

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>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>

Returns:

Number:

<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>

_getRegion

(
  • [node]
)
Object private

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>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>

Returns:

Object:

<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>

_getShimTemplate

() Node private

Creates a cloned shim node, using the SHIM_TEMPLATE html template, for use on a new instance.

Returns:

Node:

<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>

_getStdModContent

(
  • section
)
Node private

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>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>

Returns:

Node:

<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>

_getStdModTemplate

(
  • section
)
Node protected

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>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>

Returns:

Node:

<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>

_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:

Number:

<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>

_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:

Number:

<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>

_insertStdModSection

(
  • contentBox
  • section
  • sectionNode
)
private

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>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>

  • section String

    <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>

  • sectionNode Node

    <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>

_parseStdModHTML

(
  • section
)
String private

Utility method, used by WidgetStdMods HTML_PARSER implementation to extract data for each section from markup.

Parameters:

  • section String

Returns:

String:

<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>

_parseZIndex

(
  • srcNode
)
Mixed protected

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>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>

Returns:

Mixed:

<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>

_preventOverlap

(
  • val
  • axis
  • nodeRegion
  • constrainingRegion
)
Number protected

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>The value being constrain</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>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>

  • nodeRegion Region

    <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>

  • constrainingRegion Region

    <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>

Returns:

Number:

<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>

_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
)
Node protected

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>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>

Returns:

Node:

<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>

_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
)
Boolean | Node protected

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>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>

Returns:

Boolean | Node:

<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>

_setConstrain

(
  • val
)
protected

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>The attribute value</p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p></p>

_setX

(
  • val
)
protected

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>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>

_setY

(
  • val
)
protected

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>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>

_setZIndex

(
  • zIndex
)
Number protected

Default setter for zIndex attribute changes. Normalizes zIndex values to numbers, converting non-numerical values to 0.

Parameters:

Returns:

Number:

<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>

_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
)
protected

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>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>

  • points Array

    <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>

_uiSetFillHeight

(
  • fillSection
)
protected

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>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>

_uiSetShim

(
  • enable
)
protected

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>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>

_uiSetStdMod

(
  • section
  • content
  • where
)
protected

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>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>

  • content String | Node

    <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>

  • where String

    <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>

_uiSetVisiblePosAlign

(
  • visible
)
protected

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>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>

_uiSetXY

(
  • val
)
protected

Updates the UI to reflect the XY page co-ordinates passed in.

Parameters:

  • val String

    <p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>The XY page co-ordinates value 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>

_uiSetZIndex

(
  • zIndex
)
protected

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>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>

_validateFillHeight

(
  • val
)
protected

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>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>

Returns:

<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>

_validateXY

(
  • val
)
Boolean protected

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>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>

Returns:

Boolean:

<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>

align

(
  • [node]
  • [points]
)
chainable

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>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>

  • [points] Array2 optional

    <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>

Example:

Aligning to the top-left corner of the <body>:

myWidget.align('body',
                                                    [Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.TR]);

centered

(
  • [node]
)
chainable

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>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>

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>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>

  • node Node | boolean

    <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>

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>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>

getConstrainedXY

(
  • xy
  • node
)
Array

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>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>

  • node Node | boolean

    <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>

Returns:

Array:

<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>

getStdModNode

(
  • section
  • forceCreate
)
Node

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>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>

  • forceCreate Boolean

    <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>

Returns:

Node:

<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>

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>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>

  • [y] Number optional

    <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>

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>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>

  • content String | Node

    <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>

  • where String

    <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>

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.

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

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__: The Node to which the widget is to be aligned. If set to null, or not provided, the widget is aligned to the viewport.

  • __points__: A two element Array, defining the two points on the widget and Node/viewport which are to be aligned. The first element is the point on the widget, and the second element is the point on the Node/viewport. Supported alignment points are defined as static properties on WidgetPositionAlign.

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 Nodes 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 optional Node that will fire the event, it can be a Node reference or a selector String. This will default to the widget's boundingBox.

Default: []

Example:

Sync this widget's alignment on window resize:

myWidget.set('alignOn', [
                                                    {
                                                        node     : Y.one('win'),
                                                        eventName: 'resize'
                                                    }
                                                ]);

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

footerContent

HTML

The content to be added to the footer section. This will replace any existing content in the footer. If you want to append, or insert new content, use the <a href="#method_setStdModContent">setStdModContent</a> method.

Default: undefined

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

shim

Boolean

Boolean flag to indicate whether or not a shim should be added to the Widgets boundingBox, to protect it from select box bleedthrough.

Default: false, for all browsers other than IE6, for which a shim is enabled by default.

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

xy

Array

Page XY co-ordinate pair for the widget.

Default: [0,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

zIndex

Number

The z-index to apply to the Widgets boundingBox. Non-numerical values for zIndex will be converted to 0

Default: 0