diff --git a/src/directives/pagination/dirPagination.js b/src/directives/pagination/dirPagination.js index a1a7265..54583ad 100644 --- a/src/directives/pagination/dirPagination.js +++ b/src/directives/pagination/dirPagination.js @@ -33,6 +33,7 @@ .service('paginationService', paginationService) .provider('paginationTemplate', paginationTemplateProvider) .run(['$templateCache',dirPaginationControlsTemplateInstaller]); + var goToPageFor = null; function dirPaginateDirective($compile, $parse, paginationService) { @@ -222,7 +223,7 @@ } function dirPaginationControlsTemplateInstaller($templateCache) { - $templateCache.put('angularUtils.directives.dirPagination.template', '
'); + $templateCache.put('angularUtils.directives.dirPagination.template', ''); } function dirPaginationControlsDirective(paginationService, paginationTemplate) { @@ -331,6 +332,9 @@ num = parseInt(num, 10); paginationService.setCurrentPage(paginationId, num); } + else { + paginationService.setCurrentPage(paginationId, goToPageFor); + } }; /** @@ -362,6 +366,7 @@ }); } } + } function generatePagination() { @@ -431,6 +436,7 @@ var closingEllipsesNeeded = (i === paginationRange - 1 && (position === 'middle' || position === 'start')); if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) { pages.push('...'); + goToPageFor = pageNumber; } else { pages.push(pageNumber); } @@ -637,3 +643,4 @@ }; } })(); +