first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,95 @@
.yui3-scrollview-scrollbar {
opacity: 1;
position: absolute;
width: 6px;
height: 10px;
}
.yui3-scrollview-scrollbar {
top: 0;
right: 1px;
}
.yui3-scrollview-scrollbar-horiz {
top:auto;
height: 8px;
width: 20px;
bottom: 1px;
left: 0;
}
.yui3-scrollview-scrollbar .yui3-scrollview-child {
position: absolute;
right: 0px;
display: block;
width: 100%;
height: 4px;
}
.yui3-scrollview-scrollbar .yui3-scrollview-first {
top: 0;
}
.yui3-scrollview-scrollbar .yui3-scrollview-last {
top: 0;
}
.yui3-scrollview-scrollbar .yui3-scrollview-middle {
position: absolute;
top: 4px;
height: 1px;
}
.yui3-scrollview-scrollbar-horiz .yui3-scrollview-child {
display:-moz-inline-stack;
display:inline-block;
zoom:1;
*display:inline;
top: 0;
left: 0;
bottom: auto;
right: auto;
}
.yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,
.yui3-scrollview-scrollbar-horiz .yui3-scrollview-last {
width: 4px;
height: 6px;
}
.yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle {
top: 0;
left: 4px;
width: 1px;
height: 6px;
}
.yui3-scrollview-scrollbar-vert-basic {
height:auto;
}
.yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child {
position:static;
_overflow:hidden;
_line-height:4px;
}
.yui3-scrollview-scrollbar-horiz-basic {
width:auto;
white-space:nowrap;
line-height:6px;
_overflow:hidden;
}
.yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child {
position:static;
padding:0;
margin:0;
top:auto;
left:auto;
right:auto;
bottom:auto;
}
@@ -0,0 +1,96 @@
.yui3-skin-night .yui3-scrollview-scrollbar {
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate(0, 0);
}
.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-first,
.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-middle,
.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-last {
border-radius:3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
background-color:#808080;
opacity:0.3;
filter:alpha(opacity=30); /*IE*/
/* background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==);
*/
}
.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-first,
.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-last {
border-bottom-right-radius:0;
border-bottom-left-radius:0;
-webkit-border-bottom-right-radius:0;
-webkit-border-bottom-left-radius:0;
-moz-border-radius-bottomright:0;
-moz-border-radius-bottomleft:0;
}
.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-last {
border-radius:0;
border-bottom-right-radius:3px;
border-bottom-left-radius:3px;
-webkit-border-radius:0;
-webkit-border-bottom-right-radius:3px;
-webkit-border-bottom-left-radius:3px;
-webkit-transform: translate3d(0, 0, 0);
-moz-border-radius:0;
-moz-border-radius-bottomright:3px;
-moz-border-radius-bottomleft:3px;
-moz-transform: translate(0, 0);
}
.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-middle {
border-radius:0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-webkit-transform: translate3d(0,0,0) scaleY(1);
-webkit-transform-origin: 0 0;
-moz-transform: translate(0,0) scaleY(1);
-moz-transform-origin: 0 0;
}
.yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,
.yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last {
border-top-right-radius: 0;
border-bottom-left-radius: 3px;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 3px;
-moz-border-radius-topright: 0;
-moz-border-radius-bottomleft: 3px;
}
.yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last {
border-bottom-left-radius: 0;
border-top-right-radius: 3px;
-webkit-border-bottom-left-radius: 0;
-webkit-border-top-right-radius: 3px;
-moz-border-radius-bottomleft: 0;
-moz-border-radius-topright: 3px;
}
.yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle {
-webkit-transform: translate3d(0,0,0) scaleX(1);
-webkit-transform-origin: 0 0;
-moz-transform: translate(0,0) scaleX(1);
-moz-transform-origin: 0 0;
}
.yui3-skin-night .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child,
.yui3-skin-night .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child {
background-color: #aaa;
background-image: none;
}
@@ -0,0 +1 @@
.yui3-scrollview-scrollbar{opacity:1;position:absolute;width:6px;height:10px}.yui3-scrollview-scrollbar{top:0;right:1px}.yui3-scrollview-scrollbar-horiz{top:auto;height:8px;width:20px;bottom:1px;left:0}.yui3-scrollview-scrollbar .yui3-scrollview-child{position:absolute;right:0;display:block;width:100%;height:4px}.yui3-scrollview-scrollbar .yui3-scrollview-first{top:0}.yui3-scrollview-scrollbar .yui3-scrollview-last{top:0}.yui3-scrollview-scrollbar .yui3-scrollview-middle{position:absolute;top:4px;height:1px}.yui3-scrollview-scrollbar-horiz .yui3-scrollview-child{display:-moz-inline-stack;display:inline-block;zoom:1;*display:inline;top:0;left:0;bottom:auto;right:auto}.yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,.yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{width:4px;height:6px}.yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle{top:0;left:4px;width:1px;height:6px}.yui3-scrollview-scrollbar-vert-basic{height:auto}.yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child{position:static;_overflow:hidden;_line-height:4px}.yui3-scrollview-scrollbar-horiz-basic{width:auto;white-space:nowrap;line-height:6px;_overflow:hidden}.yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child{position:static;padding:0;margin:0;top:auto;left:auto;right:auto;bottom:auto}.yui3-skin-night .yui3-scrollview-scrollbar{-webkit-transform:translate3d(0,0,0);-moz-transform:translate(0,0)}.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-middle,.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;background-color:#808080;opacity:.3;filter:alpha(opacity=30)}.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-last{border-bottom-right-radius:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0}.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;-webkit-border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;-webkit-transform:translate3d(0,0,0);-moz-border-radius:0;-moz-border-radius-bottomright:3px;-moz-border-radius-bottomleft:3px;-moz-transform:translate(0,0)}.yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-middle{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-transform:translate3d(0,0,0) scaleY(1);-webkit-transform-origin:0 0;-moz-transform:translate(0,0) scaleY(1);-moz-transform-origin:0 0}.yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,.yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-top-right-radius:0;border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topright:0;-moz-border-radius-bottomleft:3px}.yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-bottom-left-radius:0;border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-top-right-radius:3px;-moz-border-radius-bottomleft:0;-moz-border-radius-topright:3px}.yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle{-webkit-transform:translate3d(0,0,0) scaleX(1);-webkit-transform-origin:0 0;-moz-transform:translate(0,0) scaleX(1);-moz-transform-origin:0 0}.yui3-skin-night .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child,.yui3-skin-night .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child{background-color:#aaa;background-image:none}#yui3-css-stamp.skin-night-scrollview-scrollbars{display:none}
@@ -0,0 +1,90 @@
.yui3-skin-sam .yui3-scrollview-scrollbar {
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate(0, 0);
}
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle,
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last {
border-radius:3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==);
}
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last {
border-bottom-right-radius:0;
border-bottom-left-radius:0;
-webkit-border-bottom-right-radius:0;
-webkit-border-bottom-left-radius:0;
-moz-border-radius-bottomright:0;
-moz-border-radius-bottomleft:0;
}
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last {
border-radius:0;
border-bottom-right-radius:3px;
border-bottom-left-radius:3px;
-webkit-border-radius:0;
-webkit-border-bottom-right-radius:3px;
-webkit-border-bottom-left-radius:3px;
-webkit-transform: translate3d(0, 0, 0);
-moz-border-radius:0;
-moz-border-radius-bottomright:3px;
-moz-border-radius-bottomleft:3px;
-moz-transform: translate(0, 0);
}
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle {
border-radius:0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-webkit-transform: translate3d(0,0,0) scaleY(1);
-webkit-transform-origin-y: 0;
-moz-transform: translate(0,0) scaleY(1);
-moz-transform-origin: 0 0;
}
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last {
border-top-right-radius: 0;
border-bottom-left-radius: 3px;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 3px;
-moz-border-radius-topright: 0;
-moz-border-radius-bottomleft: 3px;
}
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last {
border-bottom-left-radius: 0;
border-top-right-radius: 3px;
-webkit-border-bottom-left-radius: 0;
-webkit-border-top-right-radius: 3px;
-moz-border-radius-bottomleft: 0;
-moz-border-radius-topright: 3px;
}
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle {
-webkit-transform: translate3d(0,0,0) scaleX(1);
-webkit-transform-origin: 0 0;
-moz-transform: translate(0,0) scaleX(1);
-moz-transform-origin: 0 0;
}
.yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child,
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child {
background-color: #aaa;
background-image: none;
}
@@ -0,0 +1 @@
.yui3-scrollview-scrollbar{opacity:1;position:absolute;width:6px;height:10px}.yui3-scrollview-scrollbar{top:0;right:1px}.yui3-scrollview-scrollbar-horiz{top:auto;height:8px;width:20px;bottom:1px;left:0}.yui3-scrollview-scrollbar .yui3-scrollview-child{position:absolute;right:0;display:block;width:100%;height:4px}.yui3-scrollview-scrollbar .yui3-scrollview-first{top:0}.yui3-scrollview-scrollbar .yui3-scrollview-last{top:0}.yui3-scrollview-scrollbar .yui3-scrollview-middle{position:absolute;top:4px;height:1px}.yui3-scrollview-scrollbar-horiz .yui3-scrollview-child{display:-moz-inline-stack;display:inline-block;zoom:1;*display:inline;top:0;left:0;bottom:auto;right:auto}.yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,.yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{width:4px;height:6px}.yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle{top:0;left:4px;width:1px;height:6px}.yui3-scrollview-scrollbar-vert-basic{height:auto}.yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child{position:static;_overflow:hidden;_line-height:4px}.yui3-scrollview-scrollbar-horiz-basic{width:auto;white-space:nowrap;line-height:6px;_overflow:hidden}.yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child{position:static;padding:0;margin:0;top:auto;left:auto;right:auto;bottom:auto}.yui3-skin-sam .yui3-scrollview-scrollbar{-webkit-transform:translate3d(0,0,0);-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-bottom-right-radius:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;-webkit-border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;-webkit-transform:translate3d(0,0,0);-moz-border-radius:0;-moz-border-radius-bottomright:3px;-moz-border-radius-bottomleft:3px;-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-transform:translate3d(0,0,0) scaleY(1);-webkit-transform-origin-y:0;-moz-transform:translate(0,0) scaleY(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-top-right-radius:0;border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topright:0;-moz-border-radius-bottomleft:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-bottom-left-radius:0;border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-top-right-radius:3px;-moz-border-radius-bottomleft:0;-moz-border-radius-topright:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle{-webkit-transform:translate3d(0,0,0) scaleX(1);-webkit-transform-origin:0 0;-moz-transform:translate(0,0) scaleX(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child{background-color:#aaa;background-image:none}#yui3-css-stamp.skin-sam-scrollview-scrollbars{display:none}
@@ -0,0 +1,563 @@
YUI.add('scrollview-scrollbars', function (Y, NAME) {
/**
* Provides a plugin, which adds support for a scroll indicator to ScrollView instances
*
* @module scrollview
* @submodule scrollview-scrollbars
*/
var getClassName = Y.ClassNameManager.getClassName,
_classNames,
Transition = Y.Transition,
NATIVE_TRANSITIONS = Transition.useNative,
SCROLLBAR = 'scrollbar',
SCROLLVIEW = 'scrollview',
VERTICAL_NODE = "verticalNode",
HORIZONTAL_NODE = "horizontalNode",
CHILD_CACHE = "childCache",
TOP = "top",
LEFT = "left",
WIDTH = "width",
HEIGHT = "height",
HORIZ_CACHE = "_sbh",
VERT_CACHE = "_sbv",
TRANSITION_PROPERTY = Y.ScrollView._TRANSITION.PROPERTY,
TRANSFORM = "transform",
TRANSLATE_X = "translateX(",
TRANSLATE_Y = "translateY(",
SCALE_X = "scaleX(",
SCALE_Y = "scaleY(",
SCROLL_X = "scrollX",
SCROLL_Y = "scrollY",
PX = "px",
CLOSE = ")",
PX_CLOSE = PX + CLOSE;
/**
* ScrollView plugin that adds scroll indicators to ScrollView instances
*
* @class ScrollViewScrollbars
* @namespace Plugin
* @extends Plugin.Base
* @constructor
*/
function ScrollbarsPlugin() {
ScrollbarsPlugin.superclass.constructor.apply(this, arguments);
}
ScrollbarsPlugin.CLASS_NAMES = {
showing: getClassName(SCROLLVIEW, SCROLLBAR, 'showing'),
scrollbar: getClassName(SCROLLVIEW, SCROLLBAR),
scrollbarV: getClassName(SCROLLVIEW, SCROLLBAR, 'vert'),
scrollbarH: getClassName(SCROLLVIEW, SCROLLBAR, 'horiz'),
scrollbarVB: getClassName(SCROLLVIEW, SCROLLBAR, 'vert', 'basic'),
scrollbarHB: getClassName(SCROLLVIEW, SCROLLBAR, 'horiz', 'basic'),
child: getClassName(SCROLLVIEW, 'child'),
first: getClassName(SCROLLVIEW, 'first'),
middle: getClassName(SCROLLVIEW, 'middle'),
last: getClassName(SCROLLVIEW, 'last')
};
_classNames = ScrollbarsPlugin.CLASS_NAMES;
/**
* The identity of the plugin
*
* @property NAME
* @type String
* @default 'pluginScrollViewScrollbars'
* @static
*/
ScrollbarsPlugin.NAME = 'pluginScrollViewScrollbars';
/**
* The namespace on which the plugin will reside.
*
* @property NS
* @type String
* @default 'scrollbars'
* @static
*/
ScrollbarsPlugin.NS = 'scrollbars';
/**
* HTML template for the scrollbar
*
* @property SCROLLBAR_TEMPLATE
* @type Object
* @static
*/
ScrollbarsPlugin.SCROLLBAR_TEMPLATE = [
'<div>',
'<span class="' + _classNames.child + ' ' + _classNames.first + '"></span>',
'<span class="' + _classNames.child + ' ' + _classNames.middle + '"></span>',
'<span class="' + _classNames.child + ' ' + _classNames.last + '"></span>',
'</div>'
].join('');
/**
* The default attribute configuration for the plugin
*
* @property ATTRS
* @type Object
* @static
*/
ScrollbarsPlugin.ATTRS = {
/**
* Vertical scrollbar node
*
* @attribute verticalNode
* @type Y.Node
*/
verticalNode: {
setter: '_setNode',
valueFn: '_defaultNode'
},
/**
* Horizontal scrollbar node
*
* @attribute horizontalNode
* @type Y.Node
*/
horizontalNode: {
setter: '_setNode',
valueFn: '_defaultNode'
}
};
Y.namespace("Plugin").ScrollViewScrollbars = Y.extend(ScrollbarsPlugin, Y.Plugin.Base, {
/**
* Designated initializer
*
* @method initializer
*/
initializer: function() {
this._host = this.get("host");
this.afterHostEvent('scrollEnd', this._hostScrollEnd);
this.afterHostMethod('scrollTo', this._update);
this.afterHostMethod('_uiDimensionsChange', this._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.
*
* @method _hostDimensionsChange
* @protected
*/
_hostDimensionsChange: function() {
var host = this._host,
axis = host._cAxis,
scrollX = host.get(SCROLL_X),
scrollY = host.get(SCROLL_Y);
this._dims = host._getScrollDims();
if (axis && axis.y) {
this._renderBar(this.get(VERTICAL_NODE), true, 'vert');
}
if (axis && axis.x) {
this._renderBar(this.get(HORIZONTAL_NODE), true, 'horiz');
}
this._update(scrollX, scrollY);
Y.later(500, this, 'flash', true);
},
/**
* Handler for the scrollEnd event fired by the host. Default implementation flashes the scrollbar
*
* @method _hostScrollEnd
* @param {EventFacade} e The event facade.
* @protected
*/
_hostScrollEnd : function() {
var host = this._host,
scrollX = host.get(SCROLL_X),
scrollY = host.get(SCROLL_Y);
this.flash();
this._update(scrollX, scrollY);
},
/**
* Adds or removes a scrollbar node from the document.
*
* @method _renderBar
* @private
* @param {Node} bar The scrollbar node
* @param {boolean} add true, to add the node, false to remove it
*/
_renderBar: function(bar, add) {
var inDoc = bar.inDoc(),
bb = this._host._bb,
className = bar.getData("isHoriz") ? _classNames.scrollbarHB : _classNames.scrollbarVB;
if (add && !inDoc) {
bb.append(bar);
bar.toggleClass(className, this._basic);
this._setChildCache(bar);
} else if(!add && inDoc) {
bar.remove();
this._clearChildCache(bar);
}
},
/**
* Caches scrollbar child element information,
* to optimize _update implementation
*
* @method _setChildCache
* @private
* @param {Node} node
*/
_setChildCache : function(node) {
var c = node.get("children"),
fc = c.item(0),
mc = c.item(1),
lc = c.item(2),
size = node.getData("isHoriz") ? "offsetWidth" : "offsetHeight";
node.setStyle(TRANSITION_PROPERTY, TRANSFORM);
mc.setStyle(TRANSITION_PROPERTY, TRANSFORM);
lc.setStyle(TRANSITION_PROPERTY, TRANSFORM);
node.setData(CHILD_CACHE, {
fc : fc,
lc : lc,
mc : mc,
fcSize : fc && fc.get(size),
lcSize : lc && lc.get(size)
});
},
/**
* Clears child cache
*
* @method _clearChildCache
* @private
* @param {Node} node
*/
_clearChildCache : function(node) {
node.clearData(CHILD_CACHE);
},
/**
* Utility method, to move/resize either vertical or horizontal scrollbars
*
* @method _updateBar
* @private
*
* @param {Node} scrollbar The scrollbar node.
* @param {Number} current The current scroll position.
* @param {Number} duration The transition duration.
* @param {boolean} horiz true if horizontal, false if vertical.
*/
_updateBar : function(scrollbar, current, duration, horiz) {
var host = this._host,
basic = this._basic,
scrollbarSize = 0,
scrollbarPos = 1,
childCache = scrollbar.getData(CHILD_CACHE),
lastChild = childCache.lc,
middleChild = childCache.mc,
firstChildSize = childCache.fcSize,
lastChildSize = childCache.lcSize,
middleChildSize,
lastChildPosition,
transition,
translate,
scale,
dim,
dimOffset,
dimCache,
widgetSize,
contentSize;
if (horiz) {
dim = WIDTH;
dimOffset = LEFT;
dimCache = HORIZ_CACHE;
widgetSize = this._dims.offsetWidth;
contentSize = this._dims.scrollWidth;
translate = TRANSLATE_X;
scale = SCALE_X;
current = (current !== undefined) ? current : host.get(SCROLL_X);
} else {
dim = HEIGHT;
dimOffset = TOP;
dimCache = VERT_CACHE;
widgetSize = this._dims.offsetHeight;
contentSize = this._dims.scrollHeight;
translate = TRANSLATE_Y;
scale = SCALE_Y;
current = (current !== undefined) ? current : host.get(SCROLL_Y);
}
scrollbarSize = Math.floor(widgetSize * (widgetSize/contentSize));
scrollbarPos = Math.floor((current/(contentSize - widgetSize)) * (widgetSize - scrollbarSize));
if (scrollbarSize > widgetSize) {
scrollbarSize = 1;
}
if (scrollbarPos > (widgetSize - scrollbarSize)) {
scrollbarSize = scrollbarSize - (scrollbarPos - (widgetSize - scrollbarSize));
} else if (scrollbarPos < 0) {
scrollbarSize = scrollbarPos + scrollbarSize;
scrollbarPos = 0;
} else if (isNaN(scrollbarPos)) {
scrollbarPos = 0;
}
middleChildSize = (scrollbarSize - (firstChildSize + lastChildSize));
if (middleChildSize < 0) {
middleChildSize = 0;
}
if (middleChildSize === 0 && scrollbarPos !== 0) {
scrollbarPos = widgetSize - (firstChildSize + lastChildSize) - 1;
}
if (duration !== 0) {
// Position Scrollbar
transition = {
duration : duration
};
if (NATIVE_TRANSITIONS) {
transition.transform = translate + scrollbarPos + PX_CLOSE;
} else {
transition[dimOffset] = scrollbarPos + PX;
}
scrollbar.transition(transition);
} else {
if (NATIVE_TRANSITIONS) {
scrollbar.setStyle(TRANSFORM, translate + scrollbarPos + PX_CLOSE);
} else {
scrollbar.setStyle(dimOffset, scrollbarPos + PX);
}
}
// Resize Scrollbar Middle Child
if (this[dimCache] !== middleChildSize) {
this[dimCache] = middleChildSize;
if (middleChildSize > 0) {
if (duration !== 0) {
transition = {
duration : duration
};
if(NATIVE_TRANSITIONS) {
transition.transform = scale + middleChildSize + CLOSE;
} else {
transition[dim] = middleChildSize + PX;
}
middleChild.transition(transition);
} else {
if (NATIVE_TRANSITIONS) {
middleChild.setStyle(TRANSFORM, scale + middleChildSize + CLOSE);
} else {
middleChild.setStyle(dim, middleChildSize + PX);
}
}
// Position Last Child
if (!horiz || !basic) {
lastChildPosition = scrollbarSize - lastChildSize;
if(duration !== 0) {
transition = {
duration : duration
};
if (NATIVE_TRANSITIONS) {
transition.transform = translate + lastChildPosition + PX_CLOSE;
} else {
transition[dimOffset] = lastChildPosition;
}
lastChild.transition(transition);
} else {
if (NATIVE_TRANSITIONS) {
lastChild.setStyle(TRANSFORM, translate + lastChildPosition + PX_CLOSE);
} else {
lastChild.setStyle(dimOffset, lastChildPosition + PX);
}
}
}
}
}
},
/**
* AOP method, invoked after the host's _uiScrollTo method,
* to position and resize the scroll bars
*
* @method _update
* @param x {Number} The current scrollX value
* @param y {Number} The current scrollY value
* @param duration {Number} Number of ms of animation (optional) - used when snapping to bounds
* @param easing {String} Optional easing equation to use during the animation, if duration is set
* @protected
*/
_update: function(x, y, duration) {
var vNode = this.get(VERTICAL_NODE),
hNode = this.get(HORIZONTAL_NODE),
host = this._host,
axis = host._cAxis;
duration = (duration || 0)/1000;
if (!this._showing) {
this.show();
}
if (axis && axis.y && vNode && y !== null) {
this._updateBar(vNode, y, duration, false);
}
if (axis && axis.x && hNode && x !== null) {
this._updateBar(hNode, x, duration, true);
}
},
/**
* Show the scroll bar indicators
*
* @method show
* @param animated {Boolean} Whether or not to animate the showing
*/
show: function(animated) {
this._show(true, animated);
},
/**
* Hide the scroll bar indicators
*
* @method hide
* @param animated {Boolean} Whether or not to animate the hiding
*/
hide: function(animated) {
this._show(false, animated);
},
/**
* Internal hide/show implementation utility method
*
* @method _show
* @param {boolean} show Whether to show or hide the scrollbar
* @param {bolean} animated Whether or not to animate while showing/hide
* @protected
*/
_show : function(show, animated) {
var verticalNode = this.get(VERTICAL_NODE),
horizontalNode = this.get(HORIZONTAL_NODE),
duration = (animated) ? 0.6 : 0,
opacity = (show) ? 1 : 0,
transition;
this._showing = show;
if (this._flashTimer) {
this._flashTimer.cancel();
}
transition = {
duration : duration,
opacity : opacity
};
if (verticalNode && verticalNode._node) {
verticalNode.transition(transition);
}
if (horizontalNode && horizontalNode._node) {
horizontalNode.transition(transition);
}
},
/**
* Momentarily flash the scroll bars to indicate current scroll position
*
* @method flash
*/
flash: function() {
this.show(true);
this._flashTimer = Y.later(800, this, 'hide', true);
},
/**
* Setter for the verticalNode and horizontalNode attributes
*
* @method _setNode
* @param node {Node} The Y.Node instance for the scrollbar
* @param name {String} The attribute name
* @return {Node} The Y.Node instance for the scrollbar
*
* @protected
*/
_setNode: function(node, name) {
var horiz = (name === HORIZONTAL_NODE);
node = Y.one(node);
if (node) {
node.addClass(_classNames.scrollbar);
node.addClass( (horiz) ? _classNames.scrollbarH : _classNames.scrollbarV );
node.setData("isHoriz", horiz);
}
return node;
},
/**
* Creates default node instances for scrollbars
*
* @method _defaultNode
* @return {Node} The Y.Node instance for the scrollbar
*
* @protected
*/
_defaultNode: function() {
return Y.Node.create(ScrollbarsPlugin.SCROLLBAR_TEMPLATE);
},
_basic: Y.UA.ie && Y.UA.ie <= 8
});
}, '3.18.1', {"requires": ["classnamemanager", "transition", "plugin"], "skinnable": true});
@@ -0,0 +1 @@
YUI.add("scrollview-scrollbars",function(e,t){function L(){L.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r,i=e.Transition,s=i.useNative,o="scrollbar",u="scrollview",a="verticalNode",f="horizontalNode",l="childCache",c="top",h="left",p="width",d="height",v="_sbh",m="_sbv",g=e.ScrollView._TRANSITION.PROPERTY,y="transform",b="translateX(",w="translateY(",E="scaleX(",S="scaleY(",x="scrollX",T="scrollY",N="px",C=")",k=N+C;L.CLASS_NAMES={showing:n(u,o,"showing"),scrollbar:n(u,o),scrollbarV:n(u,o,"vert"),scrollbarH:n(u,o,"horiz"),scrollbarVB:n(u,o,"vert","basic"),scrollbarHB:n(u,o,"horiz","basic"),child:n(u,"child"),first:n(u,"first"),middle:n(u,"middle"),last:n(u,"last")},r=L.CLASS_NAMES,L.NAME="pluginScrollViewScrollbars",L.NS="scrollbars",L.SCROLLBAR_TEMPLATE=["<div>",'<span class="'+r.child+" "+r.first+'"></span>','<span class="'+r.child+" "+r.middle+'"></span>','<span class="'+r.child+" "+r.last+'"></span>',"</div>"].join(""),L.ATTRS={verticalNode:{setter:"_setNode",valueFn:"_defaultNode"},horizontalNode:{setter:"_setNode",valueFn:"_defaultNode"}},e.namespace("Plugin").ScrollViewScrollbars=e.extend(L,e.Plugin.Base,{initializer:function(){this._host=this.get("host"),this.afterHostEvent("scrollEnd",this._hostScrollEnd),this.afterHostMethod("scrollTo",this._update),this.afterHostMethod("_uiDimensionsChange",this._hostDimensionsChange)},_hostDimensionsChange:function(){var t=this._host,n=t._cAxis,r=t.get(x),i=t.get(T);this._dims=t._getScrollDims(),n&&n.y&&this._renderBar(this.get(a),!0,"vert"),n&&n.x&&this._renderBar(this.get(f),!0,"horiz"),this._update(r,i),e.later(500,this,"flash",!0)},_hostScrollEnd:function(){var e=this._host,t=e.get(x),n=e.get(T);this.flash(),this._update(t,n)},_renderBar:function(e,t){var n=e.inDoc(),i=this._host._bb,s=e.getData("isHoriz")?r.scrollbarHB:r.scrollbarVB;t&&!n?(i.append(e),e.toggleClass(s,this._basic),this._setChildCache(e)):!t&&n&&(e.remove(),this._clearChildCache(e))},_setChildCache:function(e){var t=e.get("children"),n=t.item(0),r=t.item(1),i=t.item(2),s=e.getData("isHoriz")?"offsetWidth":"offsetHeight";e.setStyle(g,y),r.setStyle(g,y),i.setStyle(g,y),e.setData(l,{fc:n,lc:i,mc:r,fcSize:n&&n.get(s),lcSize:i&&i.get(s)})},_clearChildCache:function(e){e.clearData(l)},_updateBar:function(e,t,n,r){var i=this._host,o=this._basic,u=0,a=1,f=e.getData(l),g=f.lc,L=f.mc,A=f.fcSize,O=f.lcSize,M,_,D,P,H,B,j,F,I,q;r?(B=p,j=h,F=v,I=this._dims.offsetWidth,q=this._dims.scrollWidth,P=b,H=E,t=t!==undefined?t:i.get(x)):(B=d,j=c,F=m,I=this._dims.offsetHeight,q=this._dims.scrollHeight,P=w,H=S,t=t!==undefined?t:i.get(T)),u=Math.floor(I*(I/q)),a=Math.floor(t/(q-I)*(I-u)),u>I&&(u=1),a>I-u?u-=a-(I-u):a<0?(u=a+u,a=0):isNaN(a)&&(a=0),M=u-(A+O),M<0&&(M=0),M===0&&a!==0&&(a=I-(A+O)-1),n!==0?(D={duration:n},s?D.transform=P+a+k:D[j]=a+N,e.transition(D)):s?e.setStyle(y,P+a+k):e.setStyle(j,a+N);if(this[F]!==M){this[F]=M;if(M>0){n!==0?(D={duration:n},s?D.transform=H+M+C:D[B]=M+N,L.transition(D)):s?L.setStyle(y,H+M+C):L.setStyle(B,M+N);if(!r||!o)_=u-O,n!==0?(D={duration:n},s?D.transform=P+_+k:D[j]=_,g.transition(D)):s?g.setStyle(y,P+_+k):g.setStyle(j,_+N)}}},_update:function(e,t,n){var r=this.get(a),i=this.get(f),s=this._host,o=s._cAxis;n=(n||0)/1e3,this._showing||this.show(),o&&o.y&&r&&t!==null&&this._updateBar(r,t,n,!1),o&&o.x&&i&&e!==null&&this._updateBar(i,e,n,!0)},show:function(e){this._show(!0,e)},hide:function(e){this._show(!1,e)},_show:function(e,t){var n=this.get(a),r=this.get(f),i=t?.6:0,s=e?1:0,o;this._showing=e,this._flashTimer&&this._flashTimer.cancel(),o={duration:i,opacity:s},n&&n._node&&n.transition(o),r&&r._node&&r.transition(o)},flash:function(){this.show(!0),this._flashTimer=e.later(800,this,"hide",!0)},_setNode:function(t,n){var i=n===f;return t=e.one(t),t&&(t.addClass(r.scrollbar),t.addClass(i?r.scrollbarH:r.scrollbarV),t.setData("isHoriz",i)),t},_defaultNode:function(){return e.Node.create(L.SCROLLBAR_TEMPLATE)},_basic:e.UA.ie&&e.UA.ie<=8})},"3.18.1",{requires:["classnamemanager","transition","plugin"],skinnable:!0});
@@ -0,0 +1,563 @@
YUI.add('scrollview-scrollbars', function (Y, NAME) {
/**
* Provides a plugin, which adds support for a scroll indicator to ScrollView instances
*
* @module scrollview
* @submodule scrollview-scrollbars
*/
var getClassName = Y.ClassNameManager.getClassName,
_classNames,
Transition = Y.Transition,
NATIVE_TRANSITIONS = Transition.useNative,
SCROLLBAR = 'scrollbar',
SCROLLVIEW = 'scrollview',
VERTICAL_NODE = "verticalNode",
HORIZONTAL_NODE = "horizontalNode",
CHILD_CACHE = "childCache",
TOP = "top",
LEFT = "left",
WIDTH = "width",
HEIGHT = "height",
HORIZ_CACHE = "_sbh",
VERT_CACHE = "_sbv",
TRANSITION_PROPERTY = Y.ScrollView._TRANSITION.PROPERTY,
TRANSFORM = "transform",
TRANSLATE_X = "translateX(",
TRANSLATE_Y = "translateY(",
SCALE_X = "scaleX(",
SCALE_Y = "scaleY(",
SCROLL_X = "scrollX",
SCROLL_Y = "scrollY",
PX = "px",
CLOSE = ")",
PX_CLOSE = PX + CLOSE;
/**
* ScrollView plugin that adds scroll indicators to ScrollView instances
*
* @class ScrollViewScrollbars
* @namespace Plugin
* @extends Plugin.Base
* @constructor
*/
function ScrollbarsPlugin() {
ScrollbarsPlugin.superclass.constructor.apply(this, arguments);
}
ScrollbarsPlugin.CLASS_NAMES = {
showing: getClassName(SCROLLVIEW, SCROLLBAR, 'showing'),
scrollbar: getClassName(SCROLLVIEW, SCROLLBAR),
scrollbarV: getClassName(SCROLLVIEW, SCROLLBAR, 'vert'),
scrollbarH: getClassName(SCROLLVIEW, SCROLLBAR, 'horiz'),
scrollbarVB: getClassName(SCROLLVIEW, SCROLLBAR, 'vert', 'basic'),
scrollbarHB: getClassName(SCROLLVIEW, SCROLLBAR, 'horiz', 'basic'),
child: getClassName(SCROLLVIEW, 'child'),
first: getClassName(SCROLLVIEW, 'first'),
middle: getClassName(SCROLLVIEW, 'middle'),
last: getClassName(SCROLLVIEW, 'last')
};
_classNames = ScrollbarsPlugin.CLASS_NAMES;
/**
* The identity of the plugin
*
* @property NAME
* @type String
* @default 'pluginScrollViewScrollbars'
* @static
*/
ScrollbarsPlugin.NAME = 'pluginScrollViewScrollbars';
/**
* The namespace on which the plugin will reside.
*
* @property NS
* @type String
* @default 'scrollbars'
* @static
*/
ScrollbarsPlugin.NS = 'scrollbars';
/**
* HTML template for the scrollbar
*
* @property SCROLLBAR_TEMPLATE
* @type Object
* @static
*/
ScrollbarsPlugin.SCROLLBAR_TEMPLATE = [
'<div>',
'<span class="' + _classNames.child + ' ' + _classNames.first + '"></span>',
'<span class="' + _classNames.child + ' ' + _classNames.middle + '"></span>',
'<span class="' + _classNames.child + ' ' + _classNames.last + '"></span>',
'</div>'
].join('');
/**
* The default attribute configuration for the plugin
*
* @property ATTRS
* @type Object
* @static
*/
ScrollbarsPlugin.ATTRS = {
/**
* Vertical scrollbar node
*
* @attribute verticalNode
* @type Y.Node
*/
verticalNode: {
setter: '_setNode',
valueFn: '_defaultNode'
},
/**
* Horizontal scrollbar node
*
* @attribute horizontalNode
* @type Y.Node
*/
horizontalNode: {
setter: '_setNode',
valueFn: '_defaultNode'
}
};
Y.namespace("Plugin").ScrollViewScrollbars = Y.extend(ScrollbarsPlugin, Y.Plugin.Base, {
/**
* Designated initializer
*
* @method initializer
*/
initializer: function() {
this._host = this.get("host");
this.afterHostEvent('scrollEnd', this._hostScrollEnd);
this.afterHostMethod('scrollTo', this._update);
this.afterHostMethod('_uiDimensionsChange', this._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.
*
* @method _hostDimensionsChange
* @protected
*/
_hostDimensionsChange: function() {
var host = this._host,
axis = host._cAxis,
scrollX = host.get(SCROLL_X),
scrollY = host.get(SCROLL_Y);
this._dims = host._getScrollDims();
if (axis && axis.y) {
this._renderBar(this.get(VERTICAL_NODE), true, 'vert');
}
if (axis && axis.x) {
this._renderBar(this.get(HORIZONTAL_NODE), true, 'horiz');
}
this._update(scrollX, scrollY);
Y.later(500, this, 'flash', true);
},
/**
* Handler for the scrollEnd event fired by the host. Default implementation flashes the scrollbar
*
* @method _hostScrollEnd
* @param {EventFacade} e The event facade.
* @protected
*/
_hostScrollEnd : function() {
var host = this._host,
scrollX = host.get(SCROLL_X),
scrollY = host.get(SCROLL_Y);
this.flash();
this._update(scrollX, scrollY);
},
/**
* Adds or removes a scrollbar node from the document.
*
* @method _renderBar
* @private
* @param {Node} bar The scrollbar node
* @param {boolean} add true, to add the node, false to remove it
*/
_renderBar: function(bar, add) {
var inDoc = bar.inDoc(),
bb = this._host._bb,
className = bar.getData("isHoriz") ? _classNames.scrollbarHB : _classNames.scrollbarVB;
if (add && !inDoc) {
bb.append(bar);
bar.toggleClass(className, this._basic);
this._setChildCache(bar);
} else if(!add && inDoc) {
bar.remove();
this._clearChildCache(bar);
}
},
/**
* Caches scrollbar child element information,
* to optimize _update implementation
*
* @method _setChildCache
* @private
* @param {Node} node
*/
_setChildCache : function(node) {
var c = node.get("children"),
fc = c.item(0),
mc = c.item(1),
lc = c.item(2),
size = node.getData("isHoriz") ? "offsetWidth" : "offsetHeight";
node.setStyle(TRANSITION_PROPERTY, TRANSFORM);
mc.setStyle(TRANSITION_PROPERTY, TRANSFORM);
lc.setStyle(TRANSITION_PROPERTY, TRANSFORM);
node.setData(CHILD_CACHE, {
fc : fc,
lc : lc,
mc : mc,
fcSize : fc && fc.get(size),
lcSize : lc && lc.get(size)
});
},
/**
* Clears child cache
*
* @method _clearChildCache
* @private
* @param {Node} node
*/
_clearChildCache : function(node) {
node.clearData(CHILD_CACHE);
},
/**
* Utility method, to move/resize either vertical or horizontal scrollbars
*
* @method _updateBar
* @private
*
* @param {Node} scrollbar The scrollbar node.
* @param {Number} current The current scroll position.
* @param {Number} duration The transition duration.
* @param {boolean} horiz true if horizontal, false if vertical.
*/
_updateBar : function(scrollbar, current, duration, horiz) {
var host = this._host,
basic = this._basic,
scrollbarSize = 0,
scrollbarPos = 1,
childCache = scrollbar.getData(CHILD_CACHE),
lastChild = childCache.lc,
middleChild = childCache.mc,
firstChildSize = childCache.fcSize,
lastChildSize = childCache.lcSize,
middleChildSize,
lastChildPosition,
transition,
translate,
scale,
dim,
dimOffset,
dimCache,
widgetSize,
contentSize;
if (horiz) {
dim = WIDTH;
dimOffset = LEFT;
dimCache = HORIZ_CACHE;
widgetSize = this._dims.offsetWidth;
contentSize = this._dims.scrollWidth;
translate = TRANSLATE_X;
scale = SCALE_X;
current = (current !== undefined) ? current : host.get(SCROLL_X);
} else {
dim = HEIGHT;
dimOffset = TOP;
dimCache = VERT_CACHE;
widgetSize = this._dims.offsetHeight;
contentSize = this._dims.scrollHeight;
translate = TRANSLATE_Y;
scale = SCALE_Y;
current = (current !== undefined) ? current : host.get(SCROLL_Y);
}
scrollbarSize = Math.floor(widgetSize * (widgetSize/contentSize));
scrollbarPos = Math.floor((current/(contentSize - widgetSize)) * (widgetSize - scrollbarSize));
if (scrollbarSize > widgetSize) {
scrollbarSize = 1;
}
if (scrollbarPos > (widgetSize - scrollbarSize)) {
scrollbarSize = scrollbarSize - (scrollbarPos - (widgetSize - scrollbarSize));
} else if (scrollbarPos < 0) {
scrollbarSize = scrollbarPos + scrollbarSize;
scrollbarPos = 0;
} else if (isNaN(scrollbarPos)) {
scrollbarPos = 0;
}
middleChildSize = (scrollbarSize - (firstChildSize + lastChildSize));
if (middleChildSize < 0) {
middleChildSize = 0;
}
if (middleChildSize === 0 && scrollbarPos !== 0) {
scrollbarPos = widgetSize - (firstChildSize + lastChildSize) - 1;
}
if (duration !== 0) {
// Position Scrollbar
transition = {
duration : duration
};
if (NATIVE_TRANSITIONS) {
transition.transform = translate + scrollbarPos + PX_CLOSE;
} else {
transition[dimOffset] = scrollbarPos + PX;
}
scrollbar.transition(transition);
} else {
if (NATIVE_TRANSITIONS) {
scrollbar.setStyle(TRANSFORM, translate + scrollbarPos + PX_CLOSE);
} else {
scrollbar.setStyle(dimOffset, scrollbarPos + PX);
}
}
// Resize Scrollbar Middle Child
if (this[dimCache] !== middleChildSize) {
this[dimCache] = middleChildSize;
if (middleChildSize > 0) {
if (duration !== 0) {
transition = {
duration : duration
};
if(NATIVE_TRANSITIONS) {
transition.transform = scale + middleChildSize + CLOSE;
} else {
transition[dim] = middleChildSize + PX;
}
middleChild.transition(transition);
} else {
if (NATIVE_TRANSITIONS) {
middleChild.setStyle(TRANSFORM, scale + middleChildSize + CLOSE);
} else {
middleChild.setStyle(dim, middleChildSize + PX);
}
}
// Position Last Child
if (!horiz || !basic) {
lastChildPosition = scrollbarSize - lastChildSize;
if(duration !== 0) {
transition = {
duration : duration
};
if (NATIVE_TRANSITIONS) {
transition.transform = translate + lastChildPosition + PX_CLOSE;
} else {
transition[dimOffset] = lastChildPosition;
}
lastChild.transition(transition);
} else {
if (NATIVE_TRANSITIONS) {
lastChild.setStyle(TRANSFORM, translate + lastChildPosition + PX_CLOSE);
} else {
lastChild.setStyle(dimOffset, lastChildPosition + PX);
}
}
}
}
}
},
/**
* AOP method, invoked after the host's _uiScrollTo method,
* to position and resize the scroll bars
*
* @method _update
* @param x {Number} The current scrollX value
* @param y {Number} The current scrollY value
* @param duration {Number} Number of ms of animation (optional) - used when snapping to bounds
* @param easing {String} Optional easing equation to use during the animation, if duration is set
* @protected
*/
_update: function(x, y, duration) {
var vNode = this.get(VERTICAL_NODE),
hNode = this.get(HORIZONTAL_NODE),
host = this._host,
axis = host._cAxis;
duration = (duration || 0)/1000;
if (!this._showing) {
this.show();
}
if (axis && axis.y && vNode && y !== null) {
this._updateBar(vNode, y, duration, false);
}
if (axis && axis.x && hNode && x !== null) {
this._updateBar(hNode, x, duration, true);
}
},
/**
* Show the scroll bar indicators
*
* @method show
* @param animated {Boolean} Whether or not to animate the showing
*/
show: function(animated) {
this._show(true, animated);
},
/**
* Hide the scroll bar indicators
*
* @method hide
* @param animated {Boolean} Whether or not to animate the hiding
*/
hide: function(animated) {
this._show(false, animated);
},
/**
* Internal hide/show implementation utility method
*
* @method _show
* @param {boolean} show Whether to show or hide the scrollbar
* @param {bolean} animated Whether or not to animate while showing/hide
* @protected
*/
_show : function(show, animated) {
var verticalNode = this.get(VERTICAL_NODE),
horizontalNode = this.get(HORIZONTAL_NODE),
duration = (animated) ? 0.6 : 0,
opacity = (show) ? 1 : 0,
transition;
this._showing = show;
if (this._flashTimer) {
this._flashTimer.cancel();
}
transition = {
duration : duration,
opacity : opacity
};
if (verticalNode && verticalNode._node) {
verticalNode.transition(transition);
}
if (horizontalNode && horizontalNode._node) {
horizontalNode.transition(transition);
}
},
/**
* Momentarily flash the scroll bars to indicate current scroll position
*
* @method flash
*/
flash: function() {
this.show(true);
this._flashTimer = Y.later(800, this, 'hide', true);
},
/**
* Setter for the verticalNode and horizontalNode attributes
*
* @method _setNode
* @param node {Node} The Y.Node instance for the scrollbar
* @param name {String} The attribute name
* @return {Node} The Y.Node instance for the scrollbar
*
* @protected
*/
_setNode: function(node, name) {
var horiz = (name === HORIZONTAL_NODE);
node = Y.one(node);
if (node) {
node.addClass(_classNames.scrollbar);
node.addClass( (horiz) ? _classNames.scrollbarH : _classNames.scrollbarV );
node.setData("isHoriz", horiz);
}
return node;
},
/**
* Creates default node instances for scrollbars
*
* @method _defaultNode
* @return {Node} The Y.Node instance for the scrollbar
*
* @protected
*/
_defaultNode: function() {
return Y.Node.create(ScrollbarsPlugin.SCROLLBAR_TEMPLATE);
},
_basic: Y.UA.ie && Y.UA.ie <= 8
});
}, '3.18.1', {"requires": ["classnamemanager", "transition", "plugin"], "skinnable": true});