From 88c1b05f50856089c9857dbd5878067ee3d3de9b Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 12 Aug 2014 16:58:16 -0400 Subject: [PATCH] House fixed issue on job template form when project was deleted, changed, or reloaded from a previous saved form --- awx/ui/static/js/controllers/JobTemplates.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/awx/ui/static/js/controllers/JobTemplates.js b/awx/ui/static/js/controllers/JobTemplates.js index aa967d330c..c3f0bf919c 100644 --- a/awx/ui/static/js/controllers/JobTemplates.js +++ b/awx/ui/static/js/controllers/JobTemplates.js @@ -467,14 +467,18 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP if ($scope.watchProjectUnregister) { $scope.watchProjectUnregister(); } - $scope.watchProjectUnregister = $scope.$watch('project_name', function (newValue, oldValue) { - if (oldValue !== newValue && newValue !== '' && newValue !== null && newValue !== undefined) { - $scope.playbook = null; + $scope.watchProjectUnregister = $scope.$watch('project', function (newValue, oldValue) { + if (newValue !== oldValue) { + if (!Empty(oldValue)) { + $scope.playbook = null; + } getPlaybooks($scope.project); checkSCMStatus(); } }); + + // Turn off 'Wait' after both cloud credential and playbook list come back if ($scope.removeJobTemplateLoadFinished) { $scope.removeJobTemplateLoadFinished();