Skip to content

Commit 51bae38

Browse files
committed
Version bump to 2.2.2
1 parent 1199cee commit 51bae38

File tree

5 files changed

+48
-11
lines changed

5 files changed

+48
-11
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
####v2.2.2: (2016-06-04) Adding Disabled Attribute
2+
3+
New Features
4+
- Added Disabled attribute support
5+
- How to use section added to the readme
6+
7+
Updates
8+
- Limited minimum Angular version to 1.3.1 due to scope watch support
9+
- Updated readme code sample section
10+
11+
---
12+
<br/>
13+
114
####v2.2.1: (2016-2-18) Bower hotfix
215

316
Updates

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-paging",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"homepage": "https://github.com/brantwills/Angular-Paging",
55
"description": "A directive to aid in paging large datasets while requiring the bare minimum of actual paging information",
66
"main": "dist/paging.js",

dist/paging.js

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ angular.module('bw.paging', []).directive('paging', function () {
4040
page: '=',
4141
pageSize: '=',
4242
total: '=',
43+
disabled: '@',
4344
dots: '@',
4445
ulClass: '@',
4546
activeClass: '@',
@@ -75,7 +76,7 @@ angular.module('bw.paging', []).directive('paging', function () {
7576
function fieldLink(scope, el, attrs) {
7677

7778
// Hook in our watched items
78-
scope.$watchCollection('[page,pageSize,total]', function () {
79+
scope.$watchCollection('[page,pageSize,total,disabled]', function () {
7980
build(scope, attrs);
8081
});
8182
}
@@ -147,7 +148,8 @@ angular.module('bw.paging', []).directive('paging', function () {
147148
scope.hideIfEmpty = evalBoolAttribute(scope, attrs.hideIfEmpty);
148149
scope.showPrevNext = evalBoolAttribute(scope, attrs.showPrevNext);
149150
scope.showFirstLast = evalBoolAttribute(scope, attrs.showFirstLast);
150-
scope.scrollTop = evalBoolAttribute(scope, attrs.scrollTop)
151+
scope.scrollTop = evalBoolAttribute(scope, attrs.scrollTop);
152+
scope.isDisabled = evalBoolAttribute(scope, attrs.disabled);
151153
}
152154

153155

@@ -210,6 +212,12 @@ angular.module('bw.paging', []).directive('paging', function () {
210212
return;
211213
}
212214

215+
// Block if we are forcing disabled
216+
if(scope.isDisabled)
217+
{
218+
return;
219+
}
220+
213221
// Update the page in scope
214222
scope.page = page;
215223

@@ -301,11 +309,11 @@ angular.module('bw.paging', []).directive('paging', function () {
301309
// Create the Add Item Function
302310
var buildItem = function (item, disabled) {
303311
return {
304-
value: item.aClass ? '' : item.value,
305312
title: item.title,
306-
liClass: disabled ? scope.disabledClass : '',
307313
aClass: item.aClass,
308-
pgHref: scope.pgHref.replace(regex, item.page),
314+
value: item.aClass ? '' : item.value,
315+
liClass: disabled ? scope.disabledClass : '',
316+
pgHref: disabled ? '' : scope.pgHref.replace(regex, item.page),
309317
action: function () {
310318
if (!disabled) {
311319
internalAction(scope, item.page);
@@ -314,6 +322,11 @@ angular.module('bw.paging', []).directive('paging', function () {
314322
};
315323
};
316324

325+
// Force disabled if specified
326+
if(scope.isDisabled){
327+
disabled = true;
328+
}
329+
317330
// Add alpha items
318331
if(alpha){
319332
var alphaItem = buildItem(alpha, disabled);
@@ -341,11 +354,22 @@ angular.module('bw.paging', []).directive('paging', function () {
341354
// Add our items where i is the page number
342355
var i = 0;
343356
for (i = start; i <= finish; i++) {
357+
358+
var pgHref = scope.pgHref.replace(regex, i);
359+
var liClass = scope.page == i ? scope.activeClass : '';
360+
361+
// Handle items that are affected by disabled
362+
if(scope.isDisabled){
363+
pgHref = '';
364+
liClass = scope.disabledClass;
365+
}
366+
367+
344368
scope.List.push({
345369
value: i,
346370
title: scope.textTitlePage.replace(regex, i),
347-
liClass: scope.page == i ? scope.activeClass : '',
348-
pgHref: scope.pgHref.replace(regex, i),
371+
liClass: liClass,
372+
pgHref: pgHref,
349373
action: function () {
350374
internalAction(scope, this.value);
351375
}

dist/paging.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-paging",
33
"distName": "paging",
4-
"version": "2.2.1",
4+
"version": "2.2.2",
55
"description": "A directive to aid in paging large datasets while requiring the bare minimum of actual paging information",
66
"main": "dist/paging.js",
77
"directories": {

0 commit comments

Comments
 (0)