- Upgrade angular-strap to fix an NPE

- Start the download of the rest of the repo information after the repo itself loads
This commit is contained in:
Joseph Schorr 2015-03-23 16:10:33 -04:00
parent 1ed814a469
commit d9c3c6689a
4 changed files with 29 additions and 21 deletions

View file

@ -13,7 +13,7 @@
}, ['old-layout']);
}]);
function RepoViewCtrl($scope, $routeParams, $location, ApiService, UserService, AngularPollChannel) {
function RepoViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel) {
$scope.namespace = $routeParams.namespace;
$scope.name = $routeParams.name;
@ -64,11 +64,19 @@
$scope.repositoryResource = ApiService.getRepoAsResource(params).get(function(repo) {
$scope.viewScope.repository = repo;
$scope.setTags($routeParams.tag);
// Track builds.
buildPollChannel = AngularPollChannel.create($scope, loadRepositoryBuilds, 5000 /* 5s */);
buildPollChannel.start();
// Load the remainder of the data async, so we don't block the initial view from
// showing.
$timeout(function() {
$scope.setTags($routeParams.tag);
// Load the images.
loadImages();
// Track builds.
buildPollChannel = AngularPollChannel.create($scope, loadRepositoryBuilds, 5000 /* 5s */);
buildPollChannel.start();
}, 10);
});
};
@ -98,9 +106,8 @@
}, errorHandler);
};
// Load the repository and images.
// Load the repository.
loadRepository();
loadImages();
$scope.setTags = function(tagNames) {
if (!tagNames) {