From 7b12dd3f4cbd3ad14416e33bb138b6e7589e69e7 Mon Sep 17 00:00:00 2001 From: Taco van Dijk Date: Fri, 8 Aug 2014 09:57:10 +0200 Subject: [PATCH] fixed paging bug --- src/js/detailcontroller.js | 3 ++- src/js/gridcontroller.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/detailcontroller.js b/src/js/detailcontroller.js index ae2616e..3e9a58b 100644 --- a/src/js/detailcontroller.js +++ b/src/js/detailcontroller.js @@ -1,7 +1,6 @@ angular.module('elviewer').controller('DetailController', ['$scope', '$routeParams', 'Repository',function DetailController($scope, $routeParams, Repository) { $scope.Repository = Repository; - //get the uid from the routing var itemId = $routeParams.itemId; @@ -11,6 +10,8 @@ angular.module('elviewer').controller('DetailController', ['$scope', '$routePara { //so wait until we have something in memory //before we try to find our item + + $scope.$watch('Repository.defaultCollection', function(newValue, oldValue) { bind(itemId,Repository,$scope); diff --git a/src/js/gridcontroller.js b/src/js/gridcontroller.js index 27dfce9..7e5f87f 100644 --- a/src/js/gridcontroller.js +++ b/src/js/gridcontroller.js @@ -14,6 +14,8 @@ angular.module('elviewer').controller('GridController', ['$scope', 'Repository', if(newValue != undefined) { $scope.applyTimeFilter(); + + } }, true @@ -112,7 +114,7 @@ angular.module('elviewer').controller('GridController', ['$scope', 'Repository', { var page_start = ($scope.page * PAGE_SIZE) + 1; - var page_end = page_start + (PAGE_SIZE - 2); + var page_end = page_start + (PAGE_SIZE - 1); var total = 0;