Yahoo! UI Library

scrollview-scrollbars  3.3.0pr1

Yahoo! UI Library > scrollview-scrollbars > Plugin.ScrollViewScrollbars
Search:
 
Filters

Class Plugin.ScrollViewScrollbars - extends Plugin.Base

ScrollView plugin that adds scroll indicators to ScrollView instances

Constructor

Plugin.ScrollViewScrollbars ( )

Properties

ScrollViewScrollbars.ATTRS - static Object

The default attribute configuration for the plugin

ScrollViewScrollbars.NAME - static String

The identity of the plugin
Default Value: 'pluginScrollViewScrollbars'

ScrollViewScrollbars.NS - static String

The namespace on which the plugin will reside.
Default Value: 'scrollbars'

ScrollViewScrollbars.SCROLLBAR_TEMPLATE - static Object

HTML template for the scrollbar

Properties inherited from Plugin.Host:

Properties inherited from Attribute:

Properties inherited from Base:

Properties inherited from Plugin.Base:

Methods

_clearChildCache

private void _clearChildCache ( node )
Clears child cache
Parameters:
node <Node>

_defaultNode

protected Node _defaultNode ( )
Creates default node instances for scrollbars
Returns: Node
The Y.Node instance for the scrollbar

_hostDimensionsChange

protected void _hostDimensionsChange ( )
Set up the DOM nodes for the scrollbars. This method is invoked whenever the host's _uiDimensionsChange fires, giving us the opportunity to remove un-needed scrollbars, as well as add one if necessary.

_hostScrollEnd

void _hostScrollEnd ( e )
Handler for the scrollEnd event fired by the host. Default implementation flashes the scrollbar
Parameters:
e <Event.Facade> The event facade.

_renderBar

private void _renderBar ( bar , add )
Adds or removes a scrollbar node from the document.
Parameters:
bar <Node> The scrollbar node
add <boolean> true, to add the node, false to remove it

_setChildCache

private void _setChildCache ( node )
Caches scrollbar child element information, to optimize _update implementation
Parameters:
node <Node>

_setNode

protected Node _setNode ( node , name )
Setter for the verticalNode and horizontalNode attributes
Parameters:
node <Node> The Y.Node instance for the scrollbar
name <String> The attribute name
Returns: Node
The Y.Node instance for the scrollbar

_show

protected void _show ( show , animated )
Internal hide/show implementation utility method
Parameters:
show <boolean> Whether to show or hide the scrollbar
animated <bolean> Whether or not to animate while showing/hide

_update

protected void _update ( x , y , duration , easing )
Position and resize the scroll bars according to the content size
Parameters:
x <Number> The current scrollX value (not used here, but passed by default from _uiScrollTo)
y <Number> The current scrollY value (not used here, but passed by default from _uiScrollTo)
duration <Number> Number of ms of animation (optional) - used when snapping to bounds
easing <String> Optional easing equation to use during the animation, if duration is set

_updateBar

private void _updateBar ( scrollbar , current , duration , horiz )
Utility method, to move/resize either vertical or horizontal scrollbars
Parameters:
scrollbar <Node> The scrollbar node.
current <Number> The current scroll position.
duration <Number> The transition duration.
horiz <boolean> true if horizontal, false if vertical.

flash

void flash ( )
Momentarily flash the scroll bars to indicate current scroll position

hide

void hide ( animated )
Hide the scroll bar indicators
Parameters:
animated <Boolean> Whether or not to animate the hiding

initializer

void initializer ( )
Designated initializer

show

void show ( animated )
Show the scroll bar indicators
Parameters:
animated <Boolean> Whether or not to animate the showing

Events

horizontalNodeChange

horizontalNodeChange ( event )
Fires when the value for the configuration attribute 'horizontalNode' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

verticalNodeChange

verticalNodeChange ( event )
Fires when the value for the configuration attribute 'verticalNode' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

Events inherited from Base:

Events inherited from Plugin.Base:

Configuration Attributes

horizontalNode - Y.Node

Horizontal scrollbar node

verticalNode - Y.Node

Vertical scrollbar node

Configuration attributes inherited from Base:

Configuration attributes inherited from Plugin.Base:


Copyright © 2010 Yahoo! Inc. All rights reserved.