From 55dea0f0dd0b9dfb48628b2fd898fcc558a8a673 Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Mon, 24 Feb 2014 01:03:14 +0100 Subject: [PATCH] Pimp pagination * Better active color * Prev/Next items --- css/style.css | 5 +++++ index.html | 10 ++++++++++ js/ctrls/download.js | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index dfe80c9..ec2ae61 100644 --- a/css/style.css +++ b/css/style.css @@ -1,3 +1,8 @@ +.pagination ul > li.active > a { + color: #fff; + background-color: #428bca; +} + .label-active, .badge-active, .progress-active .bar { background-color: #62C462; } diff --git a/index.html b/index.html index a30f28e..e3782d8 100755 --- a/index.html +++ b/index.html @@ -529,12 +529,22 @@ ng-click="setPage(1)"> « +
  • + +
  • {{page}}
  • +
  • + +
  • diff --git a/js/ctrls/download.js b/js/ctrls/download.js index d7635a3..6d4432c 100644 --- a/js/ctrls/download.js +++ b/js/ctrls/download.js @@ -162,8 +162,13 @@ function( scope.setPage = function(pageNumber) { scope.currentPage = pageNumber; + scope.currentPage = Math.max(Math.min(scope.currentPage, scope.totalPages), 1); return false; - } + }; + + scope.advancePage = function(num) { + return scope.setPage(scope.currentPage + num); + }; // get the pages to be displayed scope.getPages = function() {