Yahoo! UI Library

layout  2.6.0

Yahoo! UI Library > layout > YAHOO.widget.LayoutUnit
Search:
 
Filters

Class YAHOO.widget.LayoutUnit - extends YAHOO.util.Element

Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.

Constructor

YAHOO.widget.LayoutUnit ( el , attrs )
Parameters:
el <String/HTMLElement> The element to make a unit.
attrs <Object> Object liternal containing configuration parameters.

Properties

_anim - private YAHOO.util.Anim

A reference to the Animation instance used by this LayouUnit

_clip - private HTMLElement

A reference to the clip element used when collapsing the unit

_collapsed - private Boolean

Flag to determine if the unit is collapsed or not.

_collapsing - private Boolean

A flag set while the unit is being collapsed, used so we don't fire events while animating the size

_gutter - private Object

A simple hash table used to store the gutter to apply to the Unit

_instances - private static Object

Internal hash table for all layout unit instances

_lastCenetrScroll - private Boolean

A holder for the last known scroll state of the center unit

_lastHeight - private Number

A holder for the last known height of the unit

_lastLeft - private Number

A holder for the last known left of the unit

_lastScroll - private Boolean

A holder for the last known scroll state of the unit

_lastScrollTop - private Number

A holder for the last known scrollTop state of the unit

_lastTop - private Number

A holder for the last known top of the unit

_lastWidth - private Number

A holder for the last known width of the unit

_loading - private Number

During the loading process this variable will be true

_resize - private YAHOO.util.Resize

A reference to the Resize instance used by this LayoutUnit

_sizes - private Object

A collection of the current sizes of the contents of this Layout Unit

body - HTMLElement

A reference to the HTML element used for the body

browser - Object

A modified version of the YAHOO.env.ua object

dataConnection - Object

YUI Connection Manager handler

footer - HTMLElement

A reference to the HTML element used for the footer

header - HTMLELement

A reference to the HTML element used for the Header

loadHandler - Object

Callback method for the YUI Connection Manager used for load the body using AJAX

LOADING_CLASSNAME - String

The class name applied to dynamic tabs while loading.
Default Value: "disabled"

STR_CLOSE - {String}

String used for close button title

STR_COLLAPSE - {String}

String used for collapse button title

STR_EXPAND - {String}

String used for expand button title

Properties inherited from YAHOO.util.Element:

Properties inherited from YAHOO.util.AttributeProvider:

Methods

_cleanGrids

private void _cleanGrids ( )
This method attempts to clean up the first level of the YUI CSS Grids, YAHOO.util.Selector is required for this operation.
Returns: void

_createClip

private void _createClip ( )
Create the clip element used when the Unit is collapsed
Returns: void

_createHeader

private HTMLElement _createHeader ( )
Creates the HTMLElement for the header
Returns: HTMLElement
The new HTMLElement

_fixQuirks

private Number _fixQuirks ( el , dim , side )
Fixes the box calculations for IE in QuirksMode
Parameters:
el <HTMLElement> The HTMLElement to set the dimension on
dim <Number> The number of the dimension to fix
side <String> The dimension (h or w) to fix. Defaults to h
Returns: Number
The fixed dimension

_getBorderSizes

private Array _getBorderSizes ( el )
Get the CSS border size of the element passed.
Parameters:
el <HTMLElement> The element to get the border size of
Returns: Array
An array of the top, right, bottom, left borders.

_getBoxSize

private Array _getBoxSize ( el )
Get's the elements clientHeight and clientWidth plus the size of the borders
Parameters:
el <HTMLElement> The HTMLElement to get the size of
Returns: Array
An array of height and width

_setHeight

private Number _setHeight ( el , h )
Sets the height of the element based on the border size of the element.
Parameters:
el <HTMLElement> The HTMLElement to have it's height set
h <Number> The height that you want it the element set to
Returns: Number
The new height, fixed for borders and IE QuirksMode

_setWidth

private Number _setWidth ( el , w )
Sets the width of the element based on the border size of the element.
Parameters:
el <HTMLElement> The HTMLElement to have it's width set
w <Number> The width that you want it the element set to
Returns: Number
The new width, fixed for borders and IE QuirksMode

_toggleClip

private void _toggleClip ( )
Toggle th current state of the Clip element and set it's height, width and position
Returns: void

close

YAHOO.widget.Layout close ( )
Close the unit, removing it from the parent Layout.
Returns: YAHOO.widget.Layout
The parent Layout instance

collapse

YAHOO.widget.LayoutUnit collapse ( )
Collapse the Unit if it is not collapsed.
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

destroy

YAHOO.widget.Layout destroy ( force )
Removes this unit from the parent and cleans up after itself.
Parameters:
force <Boolean> Don't report to the parent, because we are being called from the parent.
Returns: YAHOO.widget.Layout
The parent Layout instance

expand

YAHOO.widget.LayoutUnit expand ( )
Expand the Unit if it is collapsed.
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

getLayoutUnitById

static Object getLayoutUnitById ( )
Get's a layout unit object by the HTML id of the element associated with the Layout Unit object.
Returns: Object
The Layout Object

getSizes

Object getSizes ( )
Get a reference to the internal sizes object for this unit
Returns: Object
An object of the sizes used for calculations

init

private void init ( )
The initalization method inherited from Element.
Returns: void

initAttributes

private void initAttributes ( )
Processes the config
Returns: void

loadContent

object loadContent ( )
Loading the content of the unit using the connection manager
Returns: object
YUI Connection Manager handler

resize

YAHOO.widget.LayoutUnit resize ( force )
Resize either the unit or it's clipped state, also updating the box inside
Parameters:
force <Boolean> This will force full calculations even when the unit is collapsed
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

toggle

YAHOO.widget.LayoutUnit toggle ( )
Toggles the Unit, replacing it with a clipped version.
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

toString

String toString ( )
Returns a string representing the LayoutUnit.
Returns: String

Events

animateChange

animateChange ( event )
Fires when the value for the configuration attribute 'animate' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeAnimateChange

beforeAnimateChange ( event )
Fires before the value for the configuration attribute 'animate' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeBodyChange

beforeBodyChange ( event )
Fires before the value for the configuration attribute 'body' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeCloseChange

beforeCloseChange ( event )
Fires before the value for the configuration attribute 'close' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeCollapse

beforeCollapse ( )
Fired before the unit is collapsed. If you return false, the collapse is cancelled.

beforeCollapseChange

beforeCollapseChange ( event )
Fires before the value for the configuration attribute 'collapse' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeCollapseSizeChange

beforeCollapseSizeChange ( event )
Fires before the value for the configuration attribute 'collapseSize' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeDataLoadedChange

beforeDataLoadedChange ( event )
Fires before the value for the configuration attribute 'dataLoaded' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeDataSrcChange

beforeDataSrcChange ( event )
Fires before the value for the configuration attribute 'dataSrc' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeDataTimeoutChange

beforeDataTimeoutChange ( event )
Fires before the value for the configuration attribute 'dataTimeout' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeDurationChange

beforeDurationChange ( event )
Fires before the value for the configuration attribute 'duration' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeEasingChange

beforeEasingChange ( event )
Fires before the value for the configuration attribute 'easing' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeExpand

beforeExpand ( )
Fired before the unit is exanded. If you return false, the collapse is cancelled.

beforeFooterChange

beforeFooterChange ( event )
Fires before the value for the configuration attribute 'footer' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeGridsChange

beforeGridsChange ( event )
Fires before the value for the configuration attribute 'grids' changes. Return false to cancel the attribute change.