Show:

Widget extension, which can be used to add positioning support to the base Widget class, through the <a href="Base.html#method_build">Base.build</a> method.

Methods

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

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

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

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>

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

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

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

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

Boolean:

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

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>

syncXY

()

Synchronizes the Panel's "xy", "x", and "y" properties with the Widget's position in the DOM.

Properties

ATTRS

Object static

Static property used to define the default attribute configuration introduced by WidgetPosition.

POSITIONED_CLASS_NAME

String static

Default class used to mark the boundingBox of a positioned widget.

Default: "yui-widget-positioned"

Attributes

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