Permalink
Browse files

Pagination is broken because of .page instead of .currentPage (#23)

  • Loading branch information...
1 parent 6b4f2ad commit 8e4b7fc342fd7950cd5801a6bfa4e6ff0272b905 @alexandernst alexandernst committed May 20, 2012
Showing with 7 additions and 7 deletions.
  1. +3 −3 dist/backbone.paginator.js
  2. +1 −1 dist/backbone.paginator.min.js
  3. +3 −3 lib/backbone.paginator.js
@@ -369,15 +369,15 @@ Backbone.Paginator = (function ( Backbone, _, $ ) {
else if (LASTPAGE > (5 + ADJACENTx2)) {
//close to beginning; only hide later pages
- if (info.page < (1 + ADJACENTx2)) {
+ if (info.currentPage < (1 + ADJACENTx2)) {
for (i = 1, l = 4 + ADJACENTx2; i < l; i++) {
pages.push(i);
}
}
// in middle; hide some front and some back
- else if (LASTPAGE - ADJACENTx2 > info.page && info.page > ADJACENTx2) {
- for (i = info.page - ADJACENT; i <= info.page + ADJACENT; i++) {
+ else if (LASTPAGE - ADJACENTx2 > info.currentPage && info.currentPage > ADJACENTx2) {
+ for (i = info.currentPage - ADJACENT; i <= info.currentPage + ADJACENT; i++) {
pages.push(i);
}
}
Oops, something went wrong.
@@ -366,15 +366,15 @@ Backbone.Paginator = (function ( Backbone, _, $ ) {
else if (LASTPAGE > (5 + ADJACENTx2)) {
//close to beginning; only hide later pages
- if (info.page < (1 + ADJACENTx2)) {
+ if (info.currentPage < (1 + ADJACENTx2)) {
for (i = 1, l = 4 + ADJACENTx2; i < l; i++) {
pages.push(i);
}
}
// in middle; hide some front and some back
- else if (LASTPAGE - ADJACENTx2 > info.page && info.page > ADJACENTx2) {
- for (i = info.page - ADJACENT; i <= info.page + ADJACENT; i++) {
+ else if (LASTPAGE - ADJACENTx2 > info.currentPage && info.currentPage > ADJACENTx2) {
+ for (i = info.currentPage - ADJACENT; i <= info.currentPage + ADJACENT; i++) {
pages.push(i);
}
}

0 comments on commit 8e4b7fc

Please sign in to comment.