Skip to content

Commit 33bb22b

Browse files
Update to v0.10.0
See release notes
1 parent e8d49a2 commit 33bb22b

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularUtils-pagination",
3-
"version": "0.9.4",
3+
"version": "0.10.0",
44
"homepage": "https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination",
55
"authors": [
66
"Michael Bromley <[email protected]>"

dirPagination.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@
238238

239239
if (!paginationService.isRegistered(paginationId) && !paginationService.isRegistered(rawId)) {
240240
var idMessage = (paginationId !== DEFAULT_ID) ? ' (id: ' + paginationId + ') ' : ' ';
241-
console.warn('Pagination directive: the pagination controls' + idMessage + 'cannot be used without the corresponding pagination directive, which was not found at link time.');
241+
if (window.console) {
242+
console.warn('Pagination directive: the pagination controls' + idMessage + 'cannot be used without the corresponding pagination directive, which was not found at link time.');
243+
}
242244
}
243245

244246
if (!scope.maxSize) { scope.maxSize = 9; }
@@ -309,13 +311,19 @@
309311

310312
function goToPage(num) {
311313
if (paginationService.isRegistered(paginationId) && isValidPageNumber(num)) {
314+
var oldPageNumber = scope.pagination.current;
315+
312316
scope.pages = generatePagesArray(num, paginationService.getCollectionLength(paginationId), paginationService.getItemsPerPage(paginationId), paginationRange);
313317
scope.pagination.current = num;
314318
updateRangeValues();
315319

316-
// if a callback has been set, then call it with the page number as an argument
320+
// if a callback has been set, then call it with the page number as the first argument
321+
// and the previous page number as a second argument
317322
if (scope.onPageChange) {
318-
scope.onPageChange({ newPageNumber : num });
323+
scope.onPageChange({
324+
newPageNumber : num,
325+
oldPageNumber : oldPageNumber
326+
});
319327
}
320328
}
321329
}

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package.describe({
22
name: 'angularutils:pagination',
33
summary: 'Magical automatic pagination for anything in AngularJS',
4-
version: '0.9.4',
4+
version: '0.10.0',
55
git: 'https://github.com/michaelbromley/angularUtils-pagination'
66
});
77

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-utils-pagination",
3-
"version": "0.9.4",
3+
"version": "0.10.0",
44
"description": "Magical automatic pagination for anything in AngularJS",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)