scrollview-paginator-debug.js revision d0909cb1e5af75f4a822afc98dfc0cb29917e99d
4d989d106a48742d50d9c139998f11f355aac34aSatyen Desai * Provides a plugin, which adds pagination support to ScrollView instances
4d989d106a48742d50d9c139998f11f355aac34aSatyen Desai * @module scrollview-paginator
30dcf5ec86f4223b16eb4f3cae2c4fc0812c22c9Reid Burkevar UI = (Y.ScrollView) ? Y.ScrollView.UI_SRC : "ui",
4d989d106a48742d50d9c139998f11f355aac34aSatyen Desai MAX_PAGE_COUNT = 3; // @TODO: Make configurable?
4d989d106a48742d50d9c139998f11f355aac34aSatyen Desai * Scrollview plugin that adds support for paging
4d989d106a48742d50d9c139998f11f355aac34aSatyen Desai * @class ScrollViewPaginator
4d989d106a48742d50d9c139998f11f355aac34aSatyen Desai * @namespace Plugin
4d989d106a48742d50d9c139998f11f355aac34aSatyen Desai * @extends Plugin.Base
4d989d106a48742d50d9c139998f11f355aac34aSatyen Desai * @constructor
selector: {
value: null
index: {
prevIndex: {
prevIndex: {
total: {
optimizeMemory: true,
_pageOffsets: null,
_pageNodes: null,
var paginator = this,
_calcOffsets : function() {
node;
if (optimizeMemory) {
* Neccesary because index # doesn't nessecarily map up to location in the DOM because of this._manageDOM()
// @todo: Clean this up. Probably do current (currentOffset - previousoffset) instead of assuming they're all the same width
if (optimizeMemory) {
if (forward) {
return offset;
_flickFrame: function() {
if (velocity) {
this.next();
this.prev();
return this._prevent;
_afterRender: function(e) {
_scrollEnded: function(e) {
this.next();
this.prev();
if (!e.onGestureMoveEnd){
if (optimizeMemory) {
this._manageDOM();
_manageDOM: function(){
if (isForward) {
_afterIndexChange: function(e) {
next: function() {
prev: function() {