angular-utils-pagination
Advanced tools
Comparing version 0.9.4 to 0.10.0
{ | ||
"name": "angularUtils-pagination", | ||
"version": "0.9.4", | ||
"version": "0.10.0", | ||
"homepage": "https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -241,3 +241,5 @@ /** | ||
var idMessage = (paginationId !== DEFAULT_ID) ? ' (id: ' + paginationId + ') ' : ' '; | ||
console.warn('Pagination directive: the pagination controls' + idMessage + 'cannot be used without the corresponding pagination directive, which was not found at link time.'); | ||
if (window.console) { | ||
console.warn('Pagination directive: the pagination controls' + idMessage + 'cannot be used without the corresponding pagination directive, which was not found at link time.'); | ||
} | ||
} | ||
@@ -313,2 +315,4 @@ | ||
if (paginationService.isRegistered(paginationId) && isValidPageNumber(num)) { | ||
var oldPageNumber = scope.pagination.current; | ||
scope.pages = generatePagesArray(num, paginationService.getCollectionLength(paginationId), paginationService.getItemsPerPage(paginationId), paginationRange); | ||
@@ -318,5 +322,9 @@ scope.pagination.current = num; | ||
// if a callback has been set, then call it with the page number as an argument | ||
// if a callback has been set, then call it with the page number as the first argument | ||
// and the previous page number as a second argument | ||
if (scope.onPageChange) { | ||
scope.onPageChange({ newPageNumber : num }); | ||
scope.onPageChange({ | ||
newPageNumber : num, | ||
oldPageNumber : oldPageNumber | ||
}); | ||
} | ||
@@ -323,0 +331,0 @@ } |
Package.describe({ | ||
name: 'angularutils:pagination', | ||
summary: 'Magical automatic pagination for anything in AngularJS', | ||
version: '0.9.4', | ||
version: '0.10.0', | ||
git: 'https://github.com/michaelbromley/angularUtils-pagination' | ||
@@ -6,0 +6,0 @@ }); |
{ | ||
"name": "angular-utils-pagination", | ||
"version": "0.9.4", | ||
"version": "0.10.0", | ||
"description": "Magical automatic pagination for anything in AngularJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
30446
555