aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-01-06 14:56:35 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2013-01-06 14:56:35 +0100
commita310ffdce4cd6dcbb6ba8e4fb739412ea9abdca5 (patch)
treec798cd712d273326c3ae8613e04799478af38385
parent7663c88dba4da60afde4691fc925e2f4cf6e3c4b (diff)
downloadesper-testing-a310ffdce4cd6dcbb6ba8e4fb739412ea9abdca5.tar.gz
esper-testing-a310ffdce4cd6dcbb6ba8e4fb739412ea9abdca5.tar.bz2
esper-testing-a310ffdce4cd6dcbb6ba8e4fb739412ea9abdca5.tar.xz
esper-testing-a310ffdce4cd6dcbb6ba8e4fb739412ea9abdca5.zip
o Getting the pager to work again.
-rwxr-xr-xsrc/main/webapp/apps/core/PagingTableService.js6
-rwxr-xr-xsrc/main/webapp/apps/frontPageApp/personList.html2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/webapp/apps/core/PagingTableService.js b/src/main/webapp/apps/core/PagingTableService.js
index a6a10f7..af593df 100755
--- a/src/main/webapp/apps/core/PagingTableService.js
+++ b/src/main/webapp/apps/core/PagingTableService.js
@@ -5,7 +5,7 @@ function PagingTableService() {
var self = {
rows: [],
startIndex: options.startIndex || 0,
- count: options.count
+ count: options.count || 10
};
var update = function(){
@@ -21,7 +21,7 @@ function PagingTableService() {
};
self.next = function () {
- this.startIndex += this.count;
+ self.startIndex += self.count;
update();
};
@@ -42,13 +42,13 @@ function PagingTableService() {
var defaultCallback = function(Resource, args) {
args = args || {};
return function(startIndex, count, cb) {
- console.log("fetching", arguments);
if(startIndex) {
args.startIndex = startIndex;
}
if(count) {
args.count = count;
}
+ console.log("fetching", args);
Resource.query(args, function(data, headers) {
var totalResults = headers("total-results");
console.log("totalResults", totalResults);
diff --git a/src/main/webapp/apps/frontPageApp/personList.html b/src/main/webapp/apps/frontPageApp/personList.html
index 5212ff6..5247f29 100755
--- a/src/main/webapp/apps/frontPageApp/personList.html
+++ b/src/main/webapp/apps/frontPageApp/personList.html
@@ -35,7 +35,7 @@
</div>
</div>
<ul class="pager">
- <li class="previous" ng-hide="persons.startIndex == 0">
+ <li class="previous" ng-show="persons.startIndex > 0">
<a ng-click="persons.prev()">&larr; Prev</a>
</li>
<li class="next">