Node.js based forum software built for the modern web
change pagination so its similar to GH
Barış Soner Uşaklıdde32744b7be
diff --git a/src/pagination.js b/src/pagination.jsindex 347c71ae5c..5f2d679c58 100644--- a/src/pagination.js+++ b/src/pagination.js@@ -22,7 +22,10 @@ pagination.create = function (currentPage, pageCount, queryObj) {var previous = Math.max(1, currentPage - 1);var next = Math.min(pageCount, currentPage + 1);- var startPage = currentPage - 2;+ var startPage = Math.max(1, currentPage - 2);+ if (startPage > pageCount - 5) {+ startPage -= 2 - (pageCount - currentPage);+ }for(var i = 0; i < 5; ++i) {pagesToShow.push(startPage + i);}