From 8f504d256255f7cbb7813c7c8bad47552b4b571e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lui=CC=81s=20Lobo?= Date: Wed, 12 Nov 2014 15:40:28 +0000 Subject: [PATCH 1/3] - add suport for pager-potision (currently: 'top' before table and 'bottom' after table (default)) - add suport for pager-target - can be a angular.element() compatible selector --- ng-table.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ng-table.js b/ng-table.js index a949fe03..94ada50d 100644 --- a/ng-table.js +++ b/ng-table.js @@ -649,8 +649,22 @@ app.directive('ngTable', ['$compile', '$q', '$parse', element.find('thead').remove(); element.addClass('ng-table') - .prepend(headerTemplate) - .after(paginationTemplate); + .prepend(headerTemplate); + + if(attrs.pagerTarget) { + var target = angular.element(attrs.pagerTarget); + target.replaceWith(paginationTemplate); + } else { + switch(attrs.pagerPosition) { + case 'top': + element.before(paginationTemplate); + break; + default: + case 'bottom': + element.after(paginationTemplate); + } + } + $compile(headerTemplate)(scope); $compile(paginationTemplate)(scope); From 8051cf2e970c853db323187dab96457e0e30ecab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lui=CC=81s=20Lobo?= Date: Wed, 12 Nov 2014 15:52:27 +0000 Subject: [PATCH 2/3] check if pager-target is not undefined --- ng-table.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ng-table.js b/ng-table.js index 94ada50d..69b485e3 100644 --- a/ng-table.js +++ b/ng-table.js @@ -653,7 +653,8 @@ app.directive('ngTable', ['$compile', '$q', '$parse', if(attrs.pagerTarget) { var target = angular.element(attrs.pagerTarget); - target.replaceWith(paginationTemplate); + if(target) + target.replaceWith(paginationTemplate); } else { switch(attrs.pagerPosition) { case 'top': From 0de65f142f3ae8a68c28796ad665b7402578c1a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lui=CC=81s=20Lobo?= Date: Wed, 12 Nov 2014 15:57:32 +0000 Subject: [PATCH 3/3] increment version to 0.3.3-SNAPSHOT --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index b8e09240..6cf949ab 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ng-table", - "version": "0.3.2", + "version": "0.3.3-SNAPSHOT", "main": [ "ng-table.js", "ng-table.css"