aboutsummaryrefslogtreecommitdiff
path: root/src/main/webapp/apps/personApp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-01-04 10:18:56 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2013-01-04 10:18:56 +0100
commit4a6c9c52d006ecb717bae7d9b502d9b661a08ccd (patch)
tree2b31f40d854f137a960933f5e2d99ebb98f48935 /src/main/webapp/apps/personApp
parent5c8c3467906d996c04210cc8350edbd027ccc32a (diff)
downloadesper-testing-4a6c9c52d006ecb717bae7d9b502d9b661a08ccd.tar.gz
esper-testing-4a6c9c52d006ecb717bae7d9b502d9b661a08ccd.tar.bz2
esper-testing-4a6c9c52d006ecb717bae7d9b502d9b661a08ccd.tar.xz
esper-testing-4a6c9c52d006ecb717bae7d9b502d9b661a08ccd.zip
o Using the PagingTableService on the front page and person apps.
Diffstat (limited to 'src/main/webapp/apps/personApp')
-rwxr-xr-x[-rw-r--r--]src/main/webapp/apps/personApp/personApp.js33
1 files changed, 5 insertions, 28 deletions
diff --git a/src/main/webapp/apps/personApp/personApp.js b/src/main/webapp/apps/personApp/personApp.js
index 8c13669..e8ef1d5 100644..100755
--- a/src/main/webapp/apps/personApp/personApp.js
+++ b/src/main/webapp/apps/personApp/personApp.js
@@ -1,39 +1,16 @@
'use strict';
-var personApp = angular.module('personApp', ['person', 'build']).config(function ($routeProvider, $locationProvider) {
+var personApp = angular.module('personApp', ['person', 'build', 'pagingTableService']).config(function ($routeProvider, $locationProvider) {
$routeProvider.
when('/', {controller: PersonCtrl, templateUrl: '/apps/personApp/person.html?noCache=' + noCache});
});
-function PersonCtrl($scope, $location, Person, Build) {
- function queryBuilds() {
- var builds = $scope.builds;
- Build.query({person: uuid, startIndex: builds.startIndex, count: builds.count}, function (builds) {
- $scope.builds.rows = builds;
- });
- }
+function PersonCtrl($scope, $routeParams, Person, Build, PagingTableService) {
+ var personUuid = uuid;
$scope.mode = 'overview';
- $scope.builds = {
- rows: [],
- startIndex: 0,
- count: 10,
- first: function() {
- $scope.builds.startIndex = 0;
- queryBuilds();
- },
- next: function() {
- $scope.builds.startIndex += $scope.builds.count;
- queryBuilds();
- },
- prev: function() {
- if($scope.builds.startIndex == 0) {
- return;
- }
- $scope.builds.startIndex -= $scope.builds.count;
- queryBuilds();
- }
- };
+
+ $scope.builds = PagingTableService.create($scope, PagingTableService.defaultCallback(Build, {person: personUuid}));
$scope.setMode = function(mode) {
$scope.mode = mode;