Skip to content

Commit

Permalink
Release 0.9.1
Browse files Browse the repository at this point in the history
See release notes
  • Loading branch information
michaelbromley committed Oct 16, 2015
1 parent ff5ed48 commit b540304
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular:angular@1.2.24
angularutils:pagination@0.9.0
angularutils:pagination@0.9.1
meteor@1.1.9
underscore@1.0.4
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angularUtils-pagination",
"version": "0.9.0",
"version": "0.9.1",
"homepage": "https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination",
"authors": [
"Michael Bromley <michael@michaelbromley.co.uk>"
Expand Down
20 changes: 8 additions & 12 deletions dirPagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@
/**
* Module
*/
var module;
try {
module = angular.module(moduleName);
} catch(err) {
// named module does not exist, so create one
module = angular.module(moduleName, []);
}

module
angular.module(moduleName, [])
.directive('dirPaginate', ['$compile', '$parse', 'paginationService', dirPaginateDirective])
.directive('dirPaginateNoCompile', noCompileDirective)
.directive('dirPaginationControls', ['paginationService', 'paginationTemplate', dirPaginationControlsDirective])
Expand All @@ -47,6 +39,7 @@
return {
terminal: true,
multiElement: true,
priority: 100,
compile: dirPaginationCompileFn
};

Expand All @@ -56,7 +49,7 @@
// regex taken directly from https://github.com/angular/angular.js/blob/v1.4.x/src/ng/directive/ngRepeat.js#L339
var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);

var filterPattern = /\|\s*itemsPerPage\s*:\s*(.*\(\s*\w*\)|([^\)]*?(?=as))|[^\)]*)/;
var filterPattern = /\|\s*itemsPerPage\s*:\s*(.*\(\s*\w*\)|([^\)]*?(?=\s+as\s+))|[^\)]*)/;
if (match[2].match(filterPattern) === null) {
throw 'pagination directive: the \'itemsPerPage\' filter must be set.';
}
Expand Down Expand Up @@ -188,8 +181,11 @@
if (attrs.currentPage) {
currentPageGetter = $parse(attrs.currentPage);
} else {
// if the current-page attribute was not set, we'll make our own
var defaultCurrentPage = paginationId + '__currentPage';
// If the current-page attribute was not set, we'll make our own.
// Replace any non-alphanumeric characters which might confuse
// the $parse service and give unexpected results.
// See https://github.com/michaelbromley/angularUtils/issues/233
var defaultCurrentPage = (paginationId + '__currentPage').replace(/\W/g, '_');
scope[defaultCurrentPage] = 1;
currentPageGetter = $parse(defaultCurrentPage);
}
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package.describe({
name: 'angularutils:pagination',
summary: 'Magical automatic pagination for anything in AngularJS',
version: '0.9.0',
version: '0.9.1',
git: 'https://github.com/Urigo/angularUtils-pagination'
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-utils-pagination",
"version": "0.9.0",
"version": "0.9.1",
"description": "Magical automatic pagination for anything in AngularJS",
"main": "dirPagination.js",
"scripts": {
Expand Down

0 comments on commit b540304

Please sign in to comment.