Merge pull request #759 from wknet123/dev

Refinement on paginations.
This commit is contained in:
kun wang 2016-09-05 11:50:35 +08:00 committed by GitHub
commit 146849f630
3 changed files with 6 additions and 11 deletions

View File

@ -56,14 +56,12 @@
vm.pageSize = 20;
$scope.$watch('vm.page', function(current, origin) {
if(current !== 1) {
if(current) {
vm.page = current;
retrieve(vm.queryParams, vm.page, vm.pageSize);
}
});
retrieve(vm.queryParams, vm.page, vm.pageSize);
$scope.$on('$locationChangeSuccess', function() {
vm.projectId = getParameterByName('project_id', $location.absUrl());

View File

@ -48,7 +48,6 @@
vm.tagCount = {};
vm.projectId = getParameterByName('project_id', $location.absUrl());
vm.retrieve();
$scope.$on('$locationChangeSuccess', function() {
vm.projectId = getParameterByName('project_id', $location.absUrl());
@ -62,11 +61,9 @@
vm.repositories = current || [];
}
});
$scope.$watch('vm.page', function(current) {
if(current !== 1) {
if(current) {
vm.page = current;
vm.retrieve();
}

View File

@ -30,7 +30,7 @@
vm.publicity = 0;
vm.page = 1;
vm.pageSize = 20;
vm.pageSize = 10;
vm.retrieve = retrieve;
vm.showAddProject = showAddProject;
@ -38,7 +38,6 @@
vm.showAddButton = showAddButton;
vm.togglePublicity = togglePublicity;
vm.user = currentUser.get();
vm.retrieve();
vm.getProjectRole = getProjectRole;
vm.searchProjectByKeyPress = searchProjectByKeyPress;
@ -134,6 +133,7 @@
function togglePublicity(e) {
vm.publicity = e.publicity;
vm.isOpen = false;
vm.page = 1;
vm.retrieve();
console.log('vm.publicity:' + vm.publicity);
}