Make loading of the tags tab async

This commit is contained in:
Joseph Schorr 2015-06-24 17:07:38 -04:00
parent 9e785ab019
commit 43330bcfad
4 changed files with 16 additions and 3 deletions

View file

@ -57,7 +57,9 @@
</span> </span>
</div> </div>
<table class="co-table" id="tagsTable"> <div class="cor-loader" ng-show="!isEnabled"></div>
<table class="co-table" id="tagsTable" ng-if="isEnabled">
<thead> <thead>
<td class="checkbox-col"></td> <td class="checkbox-col"></td>
<td ng-class="tablePredicateClass('name', options.predicate, options.reverse)"> <td ng-class="tablePredicateClass('name', options.predicate, options.reverse)">

View file

@ -14,6 +14,8 @@ angular.module('quay').directive('repoPanelTags', function () {
'imagesResource': '=imagesResource', 'imagesResource': '=imagesResource',
'images': '=images', 'images': '=images',
'isEnabled': '=isEnabled',
'getImages': '&getImages' 'getImages': '&getImages'
}, },
controller: function($scope, $element, $filter, $location, ApiService, UIService) { controller: function($scope, $element, $filter, $location, ApiService, UIService) {

View file

@ -20,6 +20,7 @@
$scope.imagesRequired = false; $scope.imagesRequired = false;
// Tab-enabled counters. // Tab-enabled counters.
$scope.tagsShown = 0;
$scope.logsShown = 0; $scope.logsShown = 0;
$scope.buildsShown = 0; $scope.buildsShown = 0;
$scope.settingsShown = 0; $scope.settingsShown = 0;
@ -158,6 +159,12 @@
$scope.logsShown++; $scope.logsShown++;
}; };
$scope.showTags = function() {
$timeout(function() {
$scope.tagsShown = 1;
}, 10);
};
$scope.requireImages = function() { $scope.requireImages = function() {
// Lazily load the repo's images if this is the first call to a tab // Lazily load the repo's images if this is the first call to a tab
// that needs the images. // that needs the images.

View file

@ -21,7 +21,8 @@
<i class="fa fa-info-circle"></i> <i class="fa fa-info-circle"></i>
</span> </span>
<span class="cor-tab" tab-title="Tags" tab-target="#tags" id="tagsTab"> <span class="cor-tab" tab-title="Tags" tab-target="#tags" id="tagsTab"
tab-init="showTags()">
<i class="fa fa-tags"></i> <i class="fa fa-tags"></i>
</span> </span>
@ -66,7 +67,8 @@
images="viewScope.images" images="viewScope.images"
images-resource="viewScope.imagesResource" images-resource="viewScope.imagesResource"
selected-tags="viewScope.selectedTags" selected-tags="viewScope.selectedTags"
get-images="getImages(callback)"></div> get-images="getImages(callback)"
is-enabled="tagsShown"></div>
</div> </div>
<!-- Builds --> <!-- Builds -->