diff --git a/awx/ui/static/js/directives/job-status-graph.js b/awx/ui/static/js/directives/job-status-graph.js index a24df54c9b..529fa01ad7 100644 --- a/awx/ui/static/js/directives/job-status-graph.js +++ b/awx/ui/static/js/directives/job-status-graph.js @@ -1,201 +1,157 @@ angular.module('GraphDirectives', []) - .directive('jobStatusGraph', ['$rootScope', '$compile', '$location' , '$window', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', 'jobStatusGraphData', - function ($rootScope, $compile , $location, $window, Rest, GetBasePath, ProcessErrors, Wait, jobStatusGraphData) { - return function (scope, element, attr) { + .directive('jobStatusGraph', ['$rootScope', '$compile', '$location' , '$window', 'Wait', 'jobStatusGraphData', + function ($rootScope, $compile , $location, $window, Rest, Wait, jobStatusGraphData) { + return { + restrict: 'A', + templateUrl: '/static/partials/job_status_graph.html', + link: link + }; - var html, url, job_status_chart, - period="month", - job_type="all"; + function link(scope, element, attr) { - var cleanup = angular.noop; + var html, url, job_status_chart, + period="month", + job_type="all"; - var data; - scope.$watch(attr.data, function(value) { - if (value) { - scope.$emit('graphDataReady', value); - } - }); + var cleanup = angular.noop; - scope.$on('$destroy', cleanup); + var data; + scope.$watch(attr.data, function(value) { + if (value) { + scope.$emit('graphDataReady', value); + } + }); - html = "