WidgetStack Class
yui3/src/widget-stack/js/Widget-Stack.js:46
Widget extension, which can be used to add stackable (z-index) support to the base Widget class along with a shimming solution, through the <a href="Base.html#method_build">Base.build</a> method.
Index
Methods
Properties
- ATTRS static
- HTML_PARSER static
- SHIM_CLASS_NAME static
- SHIM_TEMPLATE static
- STACKED_CLASS_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>
_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><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></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><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></p></p></p></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>
_destroyShim
()
private
Removes the shim from the DOM, and detaches any related event listeners.
_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><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></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><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></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><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></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><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></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.
_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>
_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><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></p></p></p></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.
_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><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></p></p></p></p>
_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><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></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.
Properties
ATTRS
Object
static
Static property used to define the default attribute configuration introduced by WidgetStack.
HTML_PARSER
Object
static
The HTML parsing rules for the WidgetStack class.
SHIM_CLASS_NAME
String
static
Default class used to mark the shim element
Default: "yui3-widget-shim"
SHIM_TEMPLATE
String
static
Default markup template used to generate the shim element.
STACKED_CLASS_NAME
String
static
Default class used to mark the boundingBox of a stacked widget.
Default: "yui3-widget-stacked"
Attributes
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.
zIndex
Number
The z-index to apply to the Widgets boundingBox. Non-numerical values for zIndex will be converted to 0
Default: 0