From 43330bcfadf094a715c4ef699141ddb2541fb43f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 24 Jun 2015 17:07:38 -0400 Subject: [PATCH] Make loading of the tags tab async --- static/directives/repo-view/repo-panel-tags.html | 4 +++- static/js/directives/repo-view/repo-panel-tags.js | 2 ++ static/js/pages/repo-view.js | 7 +++++++ static/partials/repo-view.html | 6 ++++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/static/directives/repo-view/repo-panel-tags.html b/static/directives/repo-view/repo-panel-tags.html index af727544c..0aa650731 100644 --- a/static/directives/repo-view/repo-panel-tags.html +++ b/static/directives/repo-view/repo-panel-tags.html @@ -57,7 +57,9 @@ - +
+ +
diff --git a/static/js/directives/repo-view/repo-panel-tags.js b/static/js/directives/repo-view/repo-panel-tags.js index 55d3183d3..181510578 100644 --- a/static/js/directives/repo-view/repo-panel-tags.js +++ b/static/js/directives/repo-view/repo-panel-tags.js @@ -14,6 +14,8 @@ angular.module('quay').directive('repoPanelTags', function () { 'imagesResource': '=imagesResource', 'images': '=images', + 'isEnabled': '=isEnabled', + 'getImages': '&getImages' }, controller: function($scope, $element, $filter, $location, ApiService, UIService) { diff --git a/static/js/pages/repo-view.js b/static/js/pages/repo-view.js index fdc579994..aff4f0997 100644 --- a/static/js/pages/repo-view.js +++ b/static/js/pages/repo-view.js @@ -20,6 +20,7 @@ $scope.imagesRequired = false; // Tab-enabled counters. + $scope.tagsShown = 0; $scope.logsShown = 0; $scope.buildsShown = 0; $scope.settingsShown = 0; @@ -158,6 +159,12 @@ $scope.logsShown++; }; + $scope.showTags = function() { + $timeout(function() { + $scope.tagsShown = 1; + }, 10); + }; + $scope.requireImages = function() { // Lazily load the repo's images if this is the first call to a tab // that needs the images. diff --git a/static/partials/repo-view.html b/static/partials/repo-view.html index d3beccd10..2ed0f1333 100644 --- a/static/partials/repo-view.html +++ b/static/partials/repo-view.html @@ -21,7 +21,8 @@ - + @@ -66,7 +67,8 @@ images="viewScope.images" images-resource="viewScope.imagesResource" selected-tags="viewScope.selectedTags" - get-images="getImages(callback)"> + get-images="getImages(callback)" + is-enabled="tagsShown">