From 5e9448b45022b5046be87f00827c4ceb8264eb20 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 11 Apr 2014 17:15:03 -0400 Subject: [PATCH] Handle the description tag handle descriptions set async after the controller has loaded --- static/js/app.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 01a54cc2b..3d068d6cc 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -4184,6 +4184,17 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi }); }; + $rootScope.$watch('description', function(description) { + if (!description) { + description = 'Hosted private docker repositories. Includes full user management and history. Free for public repositories.'; + } + + // Note: We set the content of the description tag manually here rather than using Angular binding + // because we need the tag to have a default description that is not of the form "{{ description }}", + // we read by tools that do not properly invoke the Angular code. + $('#descriptionTag').attr('content', description); + }); + $rootScope.$on('$routeUpdate', function(){ if ($location.search()['tab']) { changeTab($location.search()['tab']); @@ -4200,14 +4211,9 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi if (current.$$route.description) { $rootScope.description = current.$$route.description; } else { - $rootScope.description = 'Hosted private docker repositories. Includes full user management and history. Free for public repositories.'; + $rootScope.description = ''; } - // Note: We set the content of the description tag manually here rather than using Angular binding - // because we need the tag to have a default description that is not of the form "{{ description }}", - // we read by tools that do not properly invoke the Angular code. - $('#descriptionTag').attr('content', $rootScope.description); - $rootScope.fixFooter = !!current.$$route.fixFooter; $rootScope.current = current.$$route; });