Class Plugin.ScrollViewScrollbars
- extends Plugin.Base
ScrollView plugin that adds scroll indicators to ScrollView instances
Constructor
Plugin.ScrollViewScrollbars
(
)
Properties
The default attribute configuration for the plugin
The identity of the plugin
Default Value: 'pluginScrollViewScrollbars'
The namespace on which the plugin will reside.
Default Value: 'scrollbars'
HTML template for the scrollbar
Properties inherited from Base:
Methods
private
void
_clearChildCache
(
node
)
Clears child cache
protected
Node
_defaultNode
(
)
Creates default node instances for scrollbars
- Returns:
Node
- The Y.Node instance for the scrollbar
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.
void
_hostScrollEnd
(
e
)
Handler for the scrollEnd event fired by the host. Default implementation flashes the scrollbar
- Parameters:
-
e
<Event.Facade>
The event facade.
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
private
void
_setChildCache
(
node
)
Caches scrollbar child element information,
to optimize _update implementation
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
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
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
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.
void
flash
(
)
Momentarily flash the scroll bars to indicate current scroll position
void
hide
(
animated
)
Hide the scroll bar indicators
- Parameters:
-
animated
<Boolean>
Whether or not to animate the hiding
void
initializer
(
)
Designated initializer
void
show
(
animated
)
Show the scroll bar indicators
- Parameters:
-
animated
<Boolean>
Whether or not to animate the showing
Methods inherited from EventTarget:
_getType,
_monitor,
_parseType,
addTarget,
after,
before,
bubble,
detach,
detachAll,
fire,
getEvent,
getTargets,
on,
once,
publish,
removeTarget,
subscribe,
unsubscribe,
unsubscribeAll
Methods inherited from Attribute:
_addAttrs,
_addLazyAttr,
_defAttrChangeFn,
_fireAttrChange,
_getAttr,
_getAttrCfg,
_getAttrInitVal,
_getAttrs,
_getStateVal,
_isLazyAttr,
_normAttrVals,
_protectAttrs,
_set,
_setAttr,
_setAttrs,
_setAttrVal,
_setStateVal,
addAttr,
addAttrs,
attrAdded,
get,
getAttrs,
modifyAttr,
removeAttr,
reset,
set,
setAttrs
Methods inherited from Base:
_aggregateAttrs,
_defDestroyFn,
_defInitFn,
_destroyHierarchy,
_filterAttrCfs,
_getAttrCfgs,
_getClasses,
_initHierarchy,
_initHierarchyData,
_preInitEventCfg,
destroy,
init,
toString
Events
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
(
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:
Configuration Attributes
Horizontal scrollbar node
Configuration attributes inherited from Base: