scrollview-base.js revision 99c1985484c7dc6f8ec73d4b79fbeb2859c0334f
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * The scrollview-base module provides a basic ScrollView Widget, without scrollbar indicators
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @module scrollview-base
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeneyvar getClassName = Y.ClassNameManager.getClassName,
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * ScrollView provides a srollable widget, supporting flick gestures, across both touch and mouse based devices.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @class ScrollView
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @namespace
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param config {Object} Object literal with initial attribute values
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @extends Widget
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @constructor
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney ScrollView.superclass.constructor.apply(this, arguments);
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // Y.ScrollView prototype
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Designated initializer
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method initializer
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // Cache - they're write once, and not going to change
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Publishes events which occur during the scroll lifecycle
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _createEvents
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Notification event fired at the end of a scroll transition
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @event scrollEnd
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param e {EventFacade} The default event facade.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Notification event fired at the end of a flick gesture (the flick animation may still be in progress)
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @event flick
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param e {EventFacade} The default event facade.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Override the contentBox sizing method, since the contentBox height
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * should not be that of the boundingBox.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _uiSizeCB
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @protected
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney _uiSizeCB: function() {},
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * TranstionEnd event handler
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _transitionEnded
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * bindUI implementation
03492fa477ba30a43e50ef260c72731b9b754d91Matt Sweeney * Hooks up events for the widget
03492fa477ba30a43e50ef260c72731b9b754d91Matt Sweeney * @method bindUI
03492fa477ba30a43e50ef260c72731b9b754d91Matt Sweeney bindUI: function() {
03492fa477ba30a43e50ef260c72731b9b754d91Matt Sweeney this._bb.on('gesturemovestart', Y.bind(this._onGestureMoveStart, this));
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney cb.on('transition:end', Y.bind(this._transitionEnded, this), false);
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney // TODO: Fires way to often when using non-native transitions, due to property change
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney cb.on('DOMSubtreeModified', Y.bind(this._uiDimensionsChange, this));
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney cb.on("flick", Y.bind(this._flick, this), flick);
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney 'renderedChange': function() { Y.later(0, this, '_uiDimensionsChange'); }
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney * syncUI implementation
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney * Update the scroll position, based on the current value of scrollY
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney * @method bindUI
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney syncUI: function() {
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney this.scrollTo(this.get(SCROLL_X), this.get(SCROLL_Y));
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney * Scroll the element to a given y coordinate
db445e900d0225be4de71ea099e90c2a0ad12921Matt Sweeney * @method scrollTo
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param x {Number} The x-position to scroll to
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param y {Number} The y-position to scroll to
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param duration {Number} Duration, in ms, of the scroll animation (default is 0)
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param easing {String} An easing equation if duration is set
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney xSet = (x !== null),
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney ySet = (y !== null),
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney Y.log("Transition: duration, easing:" + transition.duration, transition.easing, "scrollview");
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney transition.transform = 'translate('+ xMove +'px,'+ yMove +'px)';
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * gesturemovestart event handler
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _onGestureMoveStart
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param e {Event.Facade} The gesturemovestart event facade
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney this._moveEvt = bb.on('gesturemove', Y.bind(this._onGestureMove, this));
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney this._moveEndEvt = bb.on('gesturemoveend', Y.bind(this._onGestureMoveEnd, this));
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney this._moveStartY = e.clientY + this.get(SCROLL_Y);
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney this._moveStartX = e.clientX + this.get(SCROLL_X);
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * gesturemove event handler
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _onGestureMove
82f3694450ab9870df1b580e54d8cb58968869f9Matt Sweeney * @param e {Event.Facade} The gesturemove event facade
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney this.set(SCROLL_Y, -(e.clientY - this._moveStartY));
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney this.set(SCROLL_X, -(e.clientX - this._moveStartX));
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * gestureend event handler
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _onGestureMoveEnd
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param e {Event.Facade} The gesturemoveend event facade
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney startPoint = this._scrollsVertical ? this._moveStartClientY : this._moveStartClientX,
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney endPoint = this._scrollsVertical ? this._moveEndClientY : this._moveEndClientX,
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney if(this._scrollsHorizontal && Math.abs(distance) > (this.get('width')/2)) {
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney if(this._scrollsVertical && Math.abs(distance) > (this.get('height')/2)) {
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // Check for minY
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney if(this._scrollsVertical && this.get(SCROLL_Y) < minY) {
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // Check for minX
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney if(this._scrollsHorizontal && this.get(SCROLL_X) < minX) {
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // Check for maxY
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // Check for maxX
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // Check for staleness
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney if(+(new Date()) - this._moveStartTime > 100) {
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * after listener for changes to the scrollY attr
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _afterScrollYChange
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param e {Event.Facade} The event
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @protected
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney this._uiScrollY(e.newVal, e.duration, e.easing);
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Update the UI when the scrollY attr changes
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _uiScrollY
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param val {Number} The scrollY value
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param duration {Number} The length (in ms) of the scroll animation
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param easing {String} An easing equation, if duration is defined
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @protected
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney duration = duration || this._snapToEdge ? 400 : 0;
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney easing = easing || this._snapToEdge ? ScrollView.SNAP_EASING : null;
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * after listener for changes to the scrollX attr
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _afterScrollXChange
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param e {Event.Facade} The event
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @protected
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney this._uiScrollX(e.newVal, e.duration, e.easing);
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * Update the UI when the scrollX attr changes
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @method _uiScrollX
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @param val {Number} The scrollX value
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @param duration {Number} The length (in ms) of the scroll animation
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @param easing {String} An easing equation, if duration is defined
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @protected
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney duration = duration || this._snapToEdge ? 400 : 0;
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney easing = easing || this._snapToEdge ? ScrollView.SNAP_EASING : null;
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * after listener for the height attribute
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @method _afterHeightChange
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @param e {Event.Facade} The event
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @protected
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * after listener for the width attribute
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @method _afterHeightChange
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @param e {Event.Facade} The event
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @protected
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * This method gets invoked whenever the height or width attrs change,
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * allowing us to determine which scrolling axes need to be enabled.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _uiDimensionsChange
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @protected
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // Use bb instead of cb. cb doesn't gives us the right results
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // in FF (due to overflow:hidden)
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney bb.addClass(ScrollView.CLASS_NAMES.horizontal);
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Execute a flick at the end of a scroll action
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _flick
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param distance {Number} The distance (in px) the user scrolled before the flick
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param time {Number} The number of ms the scroll event lasted before the flick
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @protected
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney _flick: function(e) {
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * Execute a single frame in the flick animation
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @method _flickFrame
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney * @protected
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney newY = this.get(SCROLL_Y) - (this._currentVelocity * step);
80d53e62b2ae5fa5ab6ae4fbcfcbfd8ef5764dd7Matt Sweeney newX = this.get(SCROLL_X) - (this._currentVelocity * step);
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney this._currentVelocity = (this._currentVelocity * deceleration);
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney if(Math.abs(this._currentVelocity).toFixed(4) <= 0.015) {
aab1eeae8965892252706bf128f878101c5a01b1Matt Sweeney this._killTimer(!(this._exceededYBoundary || this._exceededXBoundary));
aab1eeae8965892252706bf128f878101c5a01b1Matt Sweeney this._flickTimer = Y.later(step, this, '_flickFrame', null, true);
aab1eeae8965892252706bf128f878101c5a01b1Matt Sweeney * Stop the animation timer
aab1eeae8965892252706bf128f878101c5a01b1Matt Sweeney * @method _killTimer
aab1eeae8965892252706bf128f878101c5a01b1Matt Sweeney * @param fireEvent {Boolean} If true, fire the scrollEnd event
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney * @method _setScroll
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney * @param {Number} val
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney * @param {String} dim
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney var bouncing = this._cachedBounce || this.get(BOUNCE),
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney maxScroll = (dim == DIM_X) ? this._maxScrollX : this._maxScrollY,
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney max = bouncing ? maxScroll + range : maxScroll;
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney * Setter for the scrollX ATTR
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney * @method _setScrollX
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney * @param val {Number} The new scrollX value
deb3172da8a688abb44a22d5b084c4dd0437df89Matt Sweeney * @protected
aab1eeae8965892252706bf128f878101c5a01b1Matt Sweeney * Setter for the scrollY ATTR
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @method _setScrollY
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @param val {Number} The new scrollY value
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @protected
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney // Y.ScrollView static properties
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * The identity of the widget.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @property ScrollView.NAME
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type String
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default 'scrollview'
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @protected
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Static property used to define the default attribute configuration of
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * the Widget.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @property ScrollView.ATTRS
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type {Object}
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @protected
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * The scroll position in the y-axis
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @attribute scrollY
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type Number
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default 0
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * The scroll position in the x-axis
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @attribute scrollX
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type Number
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default 0
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Drag coefficent for inertial scrolling. The closer to 1 this
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * value is, the less friction during scrolling.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @attribute deceleration
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default 0.93
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Drag coefficient for intertial scrolling at the upper
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * and lower boundaries of the scrollview. Set to 0 to
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * disable "rubber-banding".
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @attribute bounce
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type Number
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default 0.1
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * The minimum distance and/or velocity which define a flick
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @attribute flick
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type Object
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default Object with properties minDistance = 10, minVelocity = 0.3.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * List of class names used in the scrollview's DOM
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @property ScrollView.CLASS_NAMES
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type Object
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * Flag used to source property changes initiated from the DOM
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @property ScrollView.UI_SRC
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type String
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default "ui"
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * The default bounce distance in pixels
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @property ScrollView.BOUNCE_RANGE
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type Number
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default 150
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * The step amount used when animating the flick
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @property ScrollView.FRAME_STEP
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type Number
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default 30
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * The default easing used when animating the flick
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @property ScrollView.EASING
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type String
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default 'cubic-bezier(0, 0.1, 0, 1.0)'
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * The default easing to use when animatiing the bounce snap back.
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @property ScrollView.SNAP_EASING
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @type String
fdfbb58f76522ce41b2c8af7f0a9274dcf82cd4aMatt Sweeney * @default 'ease-out'