[extensions-web/ui-cleanup: 10/12] paginator: Fix erroneous ellipses on right-hand side in certain contexts



commit 2704a6e25762d189a75d79733ce0e82d6e97d02f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jan 2 15:49:48 2012 -0500

    paginator: Fix erroneous ellipses on right-hand side in certain contexts
    
    If our last right-hand-side context is one before the end page,
    we'd show an erroneous pair of ellipses:
    
      Previous 1 ... 3 4 *5* 6 7 ... 8 Next
    
    This is a simple off-by-one error that's easily fixed

 sweettooth/static/js/paginator.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/static/js/paginator.js b/sweettooth/static/js/paginator.js
index 6e4dcc3..a62157a 100644
--- a/sweettooth/static/js/paginator.js
+++ b/sweettooth/static/js/paginator.js
@@ -119,7 +119,7 @@ define(['jquery', 'jquery.hashchange'], function($) {
                 for (var i = number+1; i < contextRight; i++)
                     makeLink(i).appendTo($elem);
 
-                if (numPages - (number+context) > 1)
+                if (numPages - (number+context) > 2)
                     $elem.append($('<span>', {'class': 'ellipses'}).text("..."));
 
                 makeLink(numPages, 'last').appendTo($elem);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]