scrollview-base-debug.js revision 6448ea60e198da82d2ea7fc33d1f1ecf3c3c8b74
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsyncYUI.add('scrollview-base', function(Y) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync/**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * The scrollview-base module provides a basic ScrollView Widget, without scrollbar indicators
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @module scrollview-base
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsyncvar getClassName = Y.ClassNameManager.getClassName,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync SCROLLVIEW = 'scrollview',
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync CLASS_NAMES = {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync vertical: getClassName(SCROLLVIEW, 'vert'),
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync horizontal: getClassName(SCROLLVIEW, 'horiz')
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync EV_SCROLL_END = 'scrollEnd',
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync EV_SCROLL_FLICK = 'flick',
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync FLICK = EV_SCROLL_FLICK,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync UI = 'ui',
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync LEFT = "left",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync TOP = "top",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync PX = "px",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
9d0256d0854254b2717550a64a6e5871a1123a0dvboxsync SCROLL_Y = "scrollY",
35396ee506ef68dd1c161f1ef2c3c0b68a146ff2vboxsync SCROLL_X = "scrollX",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync BOUNCE = "bounce",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync DIM_X = "x",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync DIM_Y = "y",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync BOUNDING_BOX = "boundingBox",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync CONTENT_BOX = "contentBox",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync EMPTY = "",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync ZERO = "0s",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync OWNER_DOC = "ownerDocument",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync MOUSE_UP = "mouseup",
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync IE = Y.UA.ie,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync NATIVE_TRANSITIONS = Y.Transition.useNative;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsyncY.Node.DOM_EVENTS.DOMSubtreeModified = true;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync/**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * ScrollView provides a scrollable widget, supporting flick gestures, across both touch and mouse based devices.
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @class ScrollView
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @namespace
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param config {Object} Object literal with initial attribute values
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @extends Widget
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @constructor
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsyncfunction ScrollView() {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync ScrollView.superclass.constructor.apply(this, arguments);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync}
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsyncY.ScrollView = Y.extend(ScrollView, Y.Widget, {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync // Y.ScrollView prototype
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Designated initializer
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method initializer
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync initializer: function() {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Notification event fired at the end of a scroll transition
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @event scrollEnd
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param e {EventFacade} The default event facade.
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Notification event fired at the end of a flick gesture (the flick animation may still be in progress)
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @event flick
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param e {EventFacade} The default event facade.
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync // Cache - they're write once, and not going to change
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._cb = this.get(CONTENT_BOX);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._bb = this.get(BOUNDING_BOX);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Override the contentBox sizing method, since the contentBox height
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * should not be that of the boundingBox.
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method _uiSizeCB
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @protected
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync _uiSizeCB: function() {},
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Content box transition callback
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method _transitionEnded
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param {Event.Facade} e The event facade
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @private
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync _transitionEnded: function(e) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this.fire(EV_SCROLL_END);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * bindUI implementation
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Hooks up events for the widget
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method bindUI
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync bindUI: function() {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync var cb = this._cb,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync bb = this._bb,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync flick = this.get(FLICK);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync bb.on('gesturemovestart', Y.bind(this._onGestureMoveStart, this));
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync // IE SELECT HACK. See if we can do this non-natively and in the gesture for a future release.
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (IE) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._nativeBody = Y.Node.getDOMNode(Y.one("body", cb.get("ownerDocument")));
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._cbDoc = cb.get(OWNER_DOC);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync cb.on("mousedown", function() {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._selectstart = this._nativeBody.onselectstart;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._nativeBody.onselectstart = this._iePreventSelect;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._cbDoc.once(MOUSE_UP, this._ieRestoreSelect, this);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }, this);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync // TODO: Fires way to often when using non-native transitions, due to property change
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (NATIVE_TRANSITIONS) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync cb.on('DOMSubtreeModified', Y.bind(this._uiDimensionsChange, this));
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (flick) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync cb.on("flick", Y.bind(this._flick, this), flick);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this.after({
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync 'scrollYChange' : this._afterScrollYChange,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync 'scrollXChange' : this._afterScrollXChange,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync 'heightChange' : this._afterHeightChange,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync 'widthChange' : this._afterWidthChange
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync });
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * syncUI implementation
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Update the scroll position, based on the current value of scrollY
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method bindUI
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync syncUI: function() {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._uiDimensionsChange();
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this.scrollTo(this.get(SCROLL_X), this.get(SCROLL_Y));
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Scroll the element to a given y coordinate
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method scrollTo
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param x {Number} The x-position to scroll to
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param y {Number} The y-position to scroll to
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param duration {Number} Duration, in ms, of the scroll animation (default is 0)
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param easing {String} An easing equation if duration is set
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync scrollTo: function(x, y, duration, easing) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync var cb = this._cb,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync xSet = (x !== null),
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync ySet = (y !== null),
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync xMove = (xSet) ? x * -1 : 0,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync yMove = (ySet) ? y * -1 : 0,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync transition,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync callback = this._transEndCallback;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync duration = duration || 0;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync easing = easing || ScrollView.EASING;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (xSet) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this.set(SCROLL_X, x, { src: UI });
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (ySet) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this.set(SCROLL_Y, y, { src: UI });
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (NATIVE_TRANSITIONS) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync // ANDROID WORKAROUND - try and stop existing transition, before kicking off new one.
f65e6cba3e74ffd3dc9e6053828dcc82b367e8devboxsync cb.setStyle(ScrollView._TRANSITION_DURATION, ZERO);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync cb.setStyle(ScrollView._TRANSITION_PROPERTY, EMPTY);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync // Causes bounce back from 0,0 instead of current translation for bottom/right edge animation
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync // cb.setStyle("WebkitTransform", cb.getComputedStyle("WebkitTransform"));
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (duration !== 0) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync transition = {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync easing : easing,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync duration : duration/1000
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync };
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (NATIVE_TRANSITIONS) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync transition.transform = 'translate3D('+ xMove +'px,'+ yMove +'px, 0px)';
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync } else {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (xSet) { transition.left = xMove + PX; }
36c5021c9ff03eb19d9818903cea95d2e43bd6bcvboxsync if (ySet) { transition.top = yMove + PX; }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync Y.log("Transition: duration, easing:" + [transition.duration, transition.easing], "scrollview");
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (!callback) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync callback = this._transEndCallback = Y.bind(this._transitionEnded, this);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync cb.transition(transition, callback);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync } else {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (NATIVE_TRANSITIONS) {
35396ee506ef68dd1c161f1ef2c3c0b68a146ff2vboxsync cb.setStyle('transform', 'translate3D('+ xMove +'px,'+ yMove +'px, 0px)');
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync } else {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (xSet) { cb.setStyle(LEFT, xMove + PX); }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (ySet) { cb.setStyle(TOP, yMove + PX); }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Native onselectstart handle to prevent selection in IE
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method _iePreventSelect
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @private
36c5021c9ff03eb19d9818903cea95d2e43bd6bcvboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync _iePreventSelect : function() {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync return false;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Restores native onselectstart handle, backed up to prevent selection in IE
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method _ieRestoreSelect
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @private
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync _ieRestoreSelect : function() {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._nativeBody.onselectstart = this._selectstart;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync _preventStart : false,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync _preventMove : true,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync _preventEnd : true,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * gesturemovestart event handler
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method _onGestureMoveStart
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync * @param e {Event.Facade} The gesturemovestart event facade
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync * @private
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync _onGestureMoveStart: function(e) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync var bb = this._bb;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync if (this._preventStart) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync e.preventDefault();
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync this._killTimer();
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync this._moveEvt = bb.on('gesturemove', Y.bind(this._onGestureMove, this));
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync this._moveEndEvt = bb.on('gesturemoveend', Y.bind(this._onGestureMoveEnd, this));
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._moveStartY = e.clientY + this.get(SCROLL_Y);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._moveStartX = e.clientX + this.get(SCROLL_X);
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._moveStartTime = (new Date()).getTime();
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._moveStartClientY = this._moveEndClientY = e.clientY;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._moveStartClientX = this._moveEndClientX = e.clientX;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Internal state, defines whether or not the scrollview is currently being dragged
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @property _isDragging
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @type boolean
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @protected
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._isDragging = false;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Internal state, defines whether or not the scrollview is currently animating a flick
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @property _flicking
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync * @type boolean
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @protected
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._flicking = false;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * Internal state, defines whether or not the scrollview needs to snap to a boundary edge
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @property _snapToEdge
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @type boolean
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @protected
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._snapToEdge = false;
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * gesturemove event handler
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method _onGestureMove
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param e {Event.Facade} The gesturemove event facade
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @private
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync _onGestureMove: function(e) {
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (this._preventMove) {
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync e.preventDefault();
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._isDragging = true;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._moveEndClientY = e.clientY;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._moveEndClientX = e.clientX;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._lastMoved = (new Date()).getTime();
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync if(this._scrollsVertical) {
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync this.set(SCROLL_Y, -(e.clientY - this._moveStartY));
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
1222ff94540f6426532c1f1714f0717fdcf92e46vboxsync if(this._scrollsHorizontal) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this.set(SCROLL_X, -(e.clientX - this._moveStartX));
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync },
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync /**
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * gestureend event handler
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync *
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @method _onGestureMoveEnd
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @param e {Event.Facade} The gesturemoveend event facade
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync * @private
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync */
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync _onGestureMoveEnd: function(e) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync if (this._preventEnd) {
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync e.preventDefault();
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync }
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync var minY = this._minScrollY,
35396ee506ef68dd1c161f1ef2c3c0b68a146ff2vboxsync maxY = this._maxScrollY,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync minX = this._minScrollX,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync maxX = this._maxScrollX,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync startPoint = this._scrollsVertical ? this._moveStartClientY : this._moveStartClientX,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync endPoint = this._scrollsVertical ? this._moveEndClientY : this._moveEndClientX,
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync distance = startPoint - endPoint;
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync
7a61a5714b9a39ac3bd59e52b0843ef498350a35vboxsync this._moveEvt.detach();
this._moveEndEvt.detach();
/**
* Internal state, defines whether or not the scrollview has been scrolled half it's width/height
*
* @property _scrolledHalfway
* @type boolean
* @protected
*/
this._scrolledHalfway = false;
this._snapToEdge = false;
this._isDragging = false;
/**
* Contains the distance (postive or negative) in pixels by which the scrollview was last scrolled. This is useful when
* setting up click listeners on the scrollview content, which on mouse based devices are always fired, even after a
* drag/flick.
*
* <p>Touch based devices don't currently fire a click event, if the finger has been moved (beyond a threshold) so this check isn't required,
* if working in a purely touch based environment</p>
*
* @property lastScrolledAmt
* @type Number
* @public
*/
this.lastScrolledAmt = distance;
if(this._scrollsHorizontal && Math.abs(distance) > (this.get('width')/2)) {
this._scrolledHalfway = true;
/**
* Internal state, defines whether or not the scrollview has been scrolled in the forward (distance > 0), or backward (distance < 0) direction
*
* @property _scrolledForward
* @type boolean
* @protected
*/
this._scrolledForward = distance > 0;
}
if(this._scrollsVertical && Math.abs(distance) > (this.get('height')/2)) {
this._scrolledHalfway = true;
this._scrolledForward = distance > 0;
}
// Check for minY
if(this._scrollsVertical && this.get(SCROLL_Y) < minY) {
this._snapToEdge = true;
this.set(SCROLL_Y, minY);
}
// Check for minX
if(this._scrollsHorizontal && this.get(SCROLL_X) < minX) {
this._snapToEdge = true;
this.set(SCROLL_X, minX);
}
// Check for maxY
if(this.get(SCROLL_Y) > maxY) {
this._snapToEdge = true;
this.set(SCROLL_Y, maxY);
}
// Check for maxX
if(this.get(SCROLL_X) > maxX) {
this._snapToEdge = true;
this.set(SCROLL_X, maxX);
}
Y.log("half:" + this._scrolledHalfway + ", fwd:" + this._scrolledForward, "scrollview");
if(this._snapToEdge) {
return;
}
this.fire(EV_SCROLL_END, {
onGestureMoveEnd: true
});
return;
},
/**
* After listener for changes to the scrollY attribute
*
* @method _afterScrollYChange
* @param e {Event.Facade} The event facade
* @protected
*/
_afterScrollYChange : function(e) {
if(e.src !== UI) {
this._uiScrollY(e.newVal, e.duration, e.easing);
}
},
/**
* Update the UI when the scrollY attribute changes
*
* @method _uiScrollY
* @param val {Number} The scrollY value
* @param duration {Number} The length (in ms) of the scroll animation
* @param easing {String} An easing equation, if duration is defined
* @protected
*/
_uiScrollY : function(val, duration, easing) {
duration = duration || this._snapToEdge ? 400 : 0;
easing = easing || this._snapToEdge ? ScrollView.SNAP_EASING : null;
this.scrollTo(null, val, duration, easing);
},
/**
* After listener for changes to the scrollX attribute
*
* @method _afterScrollXChange
* @param e {Event.Facade} The event facade
* @protected
*/
_afterScrollXChange : function(e) {
if(e.src !== UI) {
this._uiScrollX(e.newVal, e.duration, e.easing);
}
},
/**
* Update the UI when the scrollX attribute changes
*
* @method _uiScrollX
* @param val {Number} The scrollX value
* @param duration {Number} The length (in ms) of the scroll animation
* @param easing {String} An easing equation, if duration is defined
* @protected
*/
_uiScrollX : function(val, duration, easing) {
duration = duration || this._snapToEdge ? 400 : 0;
easing = easing || this._snapToEdge ? ScrollView.SNAP_EASING : null;
this.scrollTo(val, null, duration, easing);
},
/**
* After listener for the height attribute
*
* @method _afterHeightChange
* @param e {Event.Facade} The event facade
* @protected
*/
_afterHeightChange: function() {
this._uiDimensionsChange();
},
/**
* After listener for the width attribute
*
* @method _afterWidthChange
* @param e {Event.Facade} The event facade
* @protected
*/
_afterWidthChange: function() {
this._uiDimensionsChange();
},
/**
* This method gets invoked whenever the height or width attributes change,
* allowing us to determine which scrolling axes need to be enabled.
*
* @method _uiDimensionsChange
* @protected
*/
_uiDimensionsChange: function() {
var bb = this._bb,
height = this.get('height'),
width = this.get('width'),
// Use bb instead of cb. cb doesn't gives us the right results
// in FF (due to overflow:hidden)
scrollHeight = bb.get('scrollHeight'),
scrollWidth = bb.get('scrollWidth');
if(height && scrollHeight > height) {
this._scrollsVertical = true;
this._maxScrollY = scrollHeight - height;
this._minScrollY = 0;
this._scrollHeight = scrollHeight;
bb.addClass(ScrollView.CLASS_NAMES.vertical);
}
if(width && scrollWidth > width) {
this._scrollsHorizontal = true;
this._maxScrollX = scrollWidth - width;
this._minScrollX = 0;
this._scrollWidth = scrollWidth;
bb.addClass(ScrollView.CLASS_NAMES.horizontal);
}
/**
* Internal state, defines whether or not the scrollview can scroll vertically
*
* @property _scrollsVertical
* @type boolean
* @protected
*/
/**
* Internal state, defines the maximum amount that the scrollview can be scrolled along the Y axis
*
* @property _maxScrollY
* @type number
* @protected
*/
/**
* Internal state, defines the minimum amount that the scrollview can be scrolled along the Y axis
*
* @property _minScrollY
* @type number
* @protected
*/
/**
* Internal state, cached scrollHeight, for performance
*
* @property _scrollHeight
* @type number
* @protected
*/
/**
* Internal state, defines whether or not the scrollview can scroll horizontally
*
* @property _scrollsHorizontal
* @type boolean
* @protected
*/
/**
* Internal state, defines the maximum amount that the scrollview can be scrolled along the X axis
*
* @property _maxScrollX
* @type number
* @protected
*/
/**
* Internal state, defines the minimum amount that the scrollview can be scrolled along the X axis
*
* @property _minScrollX
* @type number
* @protected
*/
/**
* Internal state, cached scrollWidth, for performance
*
* @property _scrollWidth
* @type number
* @protected
*/
},
/**
* Execute a flick at the end of a scroll action
*
* @method _flick
* @param distance {Number} The distance (in px) the user scrolled before the flick
* @param time {Number} The number of ms the scroll event lasted before the flick
* @protected
*/
_flick: function(e) {
var flick = e.flick;
/**
* Internal state, currently calculated velocity from the flick
*
* @property _currentVelocity
* @type number
* @protected
*/
this._currentVelocity = flick.velocity;
this._flicking = true;
this._decelCached = this.get('deceleration');
this._bounceCached = this.get('bounce');
this._pastYEdge = false;
this._pastXEdge = false;
this._flickFrame();
this.fire(EV_SCROLL_FLICK);
},
/**
* Execute a single frame in the flick animation
*
* @method _flickFrame
* @protected
*/
_flickFrame: function() {
var newY,
maxY,
minY,
newX,
maxX,
minX,
scrollsVertical = this._scrollsVertical,
scrollsHorizontal = this._scrollsHorizontal,
deceleration = this._decelCached,
bounce = this._bounceCached,
step = ScrollView.FRAME_STEP;
if(scrollsVertical) {
maxY = this._maxScrollY;
minY = this._minScrollY;
newY = this.get(SCROLL_Y) - (this._currentVelocity * step);
}
if(scrollsHorizontal) {
maxX = this._maxScrollX;
minX = this._minScrollX;
newX = this.get(SCROLL_X) - (this._currentVelocity * step);
}
this._currentVelocity = (this._currentVelocity * deceleration);
if(Math.abs(this._currentVelocity).toFixed(4) <= 0.015) {
this._flicking = false;
this._killTimer(!(this._pastYEdge || this._pastXEdge));
if(scrollsVertical) {
if(newY < minY) {
this._snapToEdge = true;
this.set(SCROLL_Y, minY);
} else if(newY > maxY) {
this._snapToEdge = true;
this.set(SCROLL_Y, maxY);
}
}
if(scrollsHorizontal) {
if(newX < minX) {
this._snapToEdge = true;
this.set(SCROLL_X, minX);
} else if(newX > maxX) {
this._snapToEdge = true;
this.set(SCROLL_X, maxX);
}
}
return;
}
if (scrollsVertical) {
if (newY < minY || newY > maxY) {
this._pastYEdge = true;
this._currentVelocity *= bounce;
}
this.set(SCROLL_Y, newY);
}
if (scrollsHorizontal) {
if (newX < minX || newX > maxX) {
this._pastXEdge = true;
this._currentVelocity *= bounce;
}
this.set(SCROLL_X, newX);
}
if (!this._flickTimer) {
this._flickTimer = Y.later(step, this, '_flickFrame', null, true);
}
},
/**
* Stop the animation timer
*
* @method _killTimer
* @param fireEvent {Boolean} If true, fire the scrollEnd event
* @protected
*/
_killTimer: function(fireEvent) {
if(this._flickTimer) {
this._flickTimer.cancel();
this._flickTimer = null;
}
if(fireEvent) {
this.fire(EV_SCROLL_END);
}
},
/**
* The scrollX, scrollY setter implementation
*
* @method _setScroll
* @private
* @param {Number} val
* @param {String} dim
*
* @return {Number} The constrained value, if it exceeds min/max range
*/
_setScroll : function(val, dim) {
var bouncing = this._cachedBounce || this.get(BOUNCE),
range = ScrollView.BOUNCE_RANGE,
maxScroll = (dim == DIM_X) ? this._maxScrollX : this._maxScrollY,
min = bouncing ? -range : 0,
max = bouncing ? maxScroll + range : maxScroll;
if(!bouncing || !this._isDragging) {
if(val < min) {
val = min;
} else if(val > max) {
val = max;
}
}
return val;
},
/**
* Setter for the scrollX attribute
*
* @method _setScrollX
* @param val {Number} The new scrollX value
* @return {Number} The normalized value
* @protected
*/
_setScrollX: function(val) {
return this._setScroll(val, DIM_X);
},
/**
* Setter for the scrollY ATTR
*
* @method _setScrollY
* @param val {Number} The new scrollY value
* @return {Number} The normalized value
* @protected
*/
_setScrollY: function(val) {
return this._setScroll(val, DIM_Y);
}
}, {
// Y.ScrollView static properties
/**
* The identity of the widget.
*
* @property ScrollView.NAME
* @type String
* @default 'scrollview'
* @readOnly
* @protected
* @static
*/
NAME: 'scrollview',
/**
* Static property used to define the default attribute configuration of
* the Widget.
*
* @property ScrollView.ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
/**
* The scroll position in the y-axis
*
* @attribute scrollY
* @type Number
* @default 0
*/
scrollY: {
value: 0,
setter: '_setScrollY'
},
/**
* The scroll position in the x-axis
*
* @attribute scrollX
* @type Number
* @default 0
*/
scrollX: {
value: 0,
setter: '_setScrollX'
},
/**
* Drag coefficent for inertial scrolling. The closer to 1 this
* value is, the less friction during scrolling.
*
* @attribute deceleration
* @default 0.93
*/
deceleration: {
value: 0.93
},
/**
* Drag coefficient for intertial scrolling at the upper
* and lower boundaries of the scrollview. Set to 0 to
* disable "rubber-banding".
*
* @attribute bounce
* @type Number
* @default 0.1
*/
bounce: {
value: 0.1
},
/**
* The minimum distance and/or velocity which define a flick
*
* @attribute flick
* @type Object
* @default Object with properties minDistance = 10, minVelocity = 0.3.
*/
flick: {
value: {
minDistance: 10,
minVelocity: 0.3
}
}
},
/**
* List of class names used in the scrollview's DOM
*
* @property ScrollView.CLASS_NAMES
* @type Object
* @static
*/
CLASS_NAMES: CLASS_NAMES,
/**
* Flag used to source property changes initiated from the DOM
*
* @property ScrollView.UI_SRC
* @type String
* @static
* @default "ui"
*/
UI_SRC: UI,
/**
* The default bounce distance in pixels
*
* @property ScrollView.BOUNCE_RANGE
* @type Number
* @static
* @default 150
*/
BOUNCE_RANGE : 150,
/**
* The interval used when animating the flick
*
* @property ScrollView.FRAME_STEP
* @type Number
* @static
* @default 30
*/
FRAME_STEP : 30,
/**
* The default easing used when animating the flick
*
* @property ScrollView.EASING
* @type String
* @static
* @default 'cubic-bezier(0, 0.1, 0, 1.0)'
*/
EASING : 'cubic-bezier(0, 0.1, 0, 1.0)',
/**
* The default easing to use when animatiing the bounce snap back.
*
* @property ScrollView.SNAP_EASING
* @type String
* @static
* @default 'ease-out'
*/
SNAP_EASING : 'ease-out',
/**
* Style property name to use to set transition duration. Currently Webkit specific (WebkitTransitionDuration)
*
* @property ScrollView._TRANSITION_DURATION
* @private
*/
_TRANSITION_DURATION : "WebkitTransitionDuration",
/**
* Style property name to use to set transition property. Currently, Webkit specific (WebkitTransitionProperty)
*
* @property ScrollView._TRANSITION_PROPERTY
* @private
*/
_TRANSITION_PROPERTY : "WebkitTransitionProperty"
});
}, '@VERSION@' ,{skinnable:true, requires:['widget', 'event-gestures', 'transition']});