diff --git a/bower.json b/bower.json index 25b13ee..79542ea 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angularUtils-pagination", - "version": "0.7.0", + "version": "0.8.0", "homepage": "https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination", "authors": [ "Michael Bromley " @@ -10,6 +10,9 @@ "moduleType": [ "globals" ], + "dependencies": [ + "angular": ">=1.1.4" + ], "keywords": [ "angularjs", "pagination", diff --git a/dirPagination.js b/dirPagination.js index 88c80af..ab7f510 100644 --- a/dirPagination.js +++ b/dirPagination.js @@ -56,7 +56,7 @@ // regex taken directly from https://github.com/angular/angular.js/blob/master/src/ng/directive/ngRepeat.js#L211 var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/); - var filterPattern = /\|\s*itemsPerPage\s*:[^|]*/; + var filterPattern = /\|\s*itemsPerPage\s*:[^|\)]*/; if (match[2].match(filterPattern) === null) { throw 'pagination directive: the \'itemsPerPage\' filter must be set.'; } @@ -210,7 +210,7 @@ } function dirPaginationControlsTemplateInstaller($templateCache) { - $templateCache.put('angularUtils.directives.dirPagination.template', ''); + $templateCache.put('angularUtils.directives.dirPagination.template', ''); } function dirPaginationControlsDirective(paginationService, paginationTemplate) { @@ -225,7 +225,8 @@ scope: { maxSize: '=?', onPageChange: '&?', - paginationId: '=?' + paginationId: '=?', + autoHide: '=?' }, link: dirPaginationControlsLinkFn }; @@ -244,6 +245,7 @@ } if (!scope.maxSize) { scope.maxSize = 9; } + scope.autoHide = scope.autoHide === undefined ? true : scope.autoHide; scope.directionLinks = angular.isDefined(attrs.directionLinks) ? scope.$parent.$eval(attrs.directionLinks) : true; scope.boundaryLinks = angular.isDefined(attrs.boundaryLinks) ? scope.$parent.$eval(attrs.boundaryLinks) : false; diff --git a/package.json b/package.json index 0625412..6b524c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-utils-pagination", - "version": "0.7.0", + "version": "0.8.0", "description": "Magical automatic pagination for anything in AngularJS", "main": "index.js", "scripts": {