From d10a597b3c2c088e8bb5042395dc3503470f2e5d Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Fri, 5 Jun 2015 11:52:08 -0400 Subject: [PATCH] Fixed console error when running system jobs a chunk of code was referring to job_scope before it had been instantiated as a scope object --- awx/ui/static/js/controllers/Jobs.js | 32 +++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/awx/ui/static/js/controllers/Jobs.js b/awx/ui/static/js/controllers/Jobs.js index f37267cea5..14948d59e6 100644 --- a/awx/ui/static/js/controllers/Jobs.js +++ b/awx/ui/static/js/controllers/Jobs.js @@ -3,7 +3,7 @@ * * All Rights Reserved *************************************************/ - + /** * @ngdoc function * @name controllers.function:Jobs @@ -25,21 +25,7 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $routePa LoadBreadCrumbs(); - if ($rootScope.removeJobStatusChange) { - $rootScope.removeJobStatusChange(); - } - $rootScope.removeJobStatusChange = $rootScope.$on('JobStatusChange-jobs', function() { - jobs_scope.refreshJobs(); - }); - if ($rootScope.removeScheduleStatusChange) { - $rootScope.removeScheduleStatusChange(); - } - $rootScope.removeScheduleStatusChange = $rootScope.$on('ScheduleStatusChange', function() { - if (api_complete) { - scheduled_scope.search('schedule'); - } - }); if ($scope.removeListLoaded) { $scope.removeListLoaded(); @@ -103,6 +89,22 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $routePa scheduled_scope.search('schedule'); }; + if ($rootScope.removeJobStatusChange) { + $rootScope.removeJobStatusChange(); + } + $rootScope.removeJobStatusChange = $rootScope.$on('JobStatusChange-jobs', function() { + jobs_scope.refreshJobs(); + }); + + if ($rootScope.removeScheduleStatusChange) { + $rootScope.removeScheduleStatusChange(); + } + $rootScope.removeScheduleStatusChange = $rootScope.$on('ScheduleStatusChange', function() { + if (api_complete) { + scheduled_scope.search('schedule'); + } + }); + $(window).resize(_.debounce(function() { resizeContainers(); }, 500));