[extensions-web/filter-sort-ui: 15/20] js: Fix erroneous ellipses on right-hand side in certain contexts



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

    js: 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 ee3f062..1f8ff7a 100644
--- a/sweettooth/static/js/paginator.js
+++ b/sweettooth/static/js/paginator.js
@@ -87,7 +87,7 @@ define(['jquery', 'hashparamutils', 'jquery.hashchange'], function($, hashparamu
                 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]