From 38b8ed4e9ec5a64c6db1252f4f7c7ff23de86d8c Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Tue, 27 Jan 2015 16:23:51 -0500 Subject: [PATCH] Remove extraneous unused code/comments --- awx/ui/static/js/controllers/Home.js | 37 ------------------- .../static/js/directives/host-count-graph.js | 3 -- .../static/js/directives/host-status-graph.js | 4 +- .../static/js/directives/job-status-graph.js | 19 +--------- 4 files changed, 2 insertions(+), 61 deletions(-) diff --git a/awx/ui/static/js/controllers/Home.js b/awx/ui/static/js/controllers/Home.js index b2164f037b..d6a2778ca2 100644 --- a/awx/ui/static/js/controllers/Home.js +++ b/awx/ui/static/js/controllers/Home.js @@ -72,26 +72,6 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait, //Wait('start'); } - if ($scope.removeWidgetLoaded) { - $scope.removeWidgetLoaded(); - } - $scope.removeWidgetLoaded = $scope.$on('WidgetLoaded', function (e, label, jobscope, schedulescope) { - // Once all the widgets report back 'loaded', turn off Wait widget - if(label==="dashboard_jobs"){ - jobs_scope = jobscope; - schedule_scope = schedulescope; - } - loadedCount++; - if (loadedCount === waitCount) { - // console.log('binding to resize'); - // angular.element($window).on('resize', _.debounce(function() { - // console.log('resize from controller'); - // Wait('stop'); - // }, 500)); - // $(window).resize(); - } - }); - if ($scope.removeDashboardReady) { $scope.removeDashboardReady(); } @@ -130,23 +110,6 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait, }); - if ($rootScope.removeJobStatusChange) { - $rootScope.removeJobStatusChange(); - } - // $rootScope.removeJobStatusChange = $rootScope.$on('JobStatusChange', function() { - // jobs_scope.refreshJobs(); - // $scope.$emit('ReloadJobStatusGraph'); - - // }); - - if ($rootScope.removeScheduleChange) { - $rootScope.removeScheduleChange(); - } - $rootScope.removeScheduleChange = $rootScope.$on('ScheduleChange', function() { - schedule_scope.refreshSchedules(); - $scope.$emit('ReloadJobStatusGraph'); - }); - $scope.showActivity = function () { Stream({ scope: $scope diff --git a/awx/ui/static/js/directives/host-count-graph.js b/awx/ui/static/js/directives/host-count-graph.js index 24d532b53e..debf9b49e5 100644 --- a/awx/ui/static/js/directives/host-count-graph.js +++ b/awx/ui/static/js/directives/host-count-graph.js @@ -94,8 +94,6 @@ angular.module('DashboardGraphs'). .duration(500) .call(license_graph) .style({ - // 'width': width, - // 'height': height, "font-family": 'Open Sans', "font-style": "normal", "font-weight":400, @@ -103,7 +101,6 @@ angular.module('DashboardGraphs'). }); - // nv.utils.windowResize(license_graph.update); scope.$emit('WidgetLoaded'); adjustGraphSize(license_graph, element); diff --git a/awx/ui/static/js/directives/host-status-graph.js b/awx/ui/static/js/directives/host-status-graph.js index f9b5a95d2f..a724d03724 100644 --- a/awx/ui/static/js/directives/host-status-graph.js +++ b/awx/ui/static/js/directives/host-status-graph.js @@ -67,8 +67,6 @@ angular.module('DashboardGraphs') d3.select(element.find('svg')[0]) .datum(data) - // .attr('width', width) - // .attr('height', height) .transition().duration(350) .call(host_pie_chart) .style({ @@ -77,7 +75,7 @@ angular.module('DashboardGraphs') "font-weight":400, "src": "url(/static/fonts/OpenSans-Regular.ttf)" }); - // nv.utils.windowResize(host_pie_chart.update); + adjustGraphSize(); return host_pie_chart; } diff --git a/awx/ui/static/js/directives/job-status-graph.js b/awx/ui/static/js/directives/job-status-graph.js index 440e1709c6..a9d88b4864 100644 --- a/awx/ui/static/js/directives/job-status-graph.js +++ b/awx/ui/static/js/directives/job-status-graph.js @@ -11,7 +11,6 @@ angular.module('DashboardGraphs') var html; var url; var job_status_chart; - var job_status_chart; var cleanup = angular.noop; scope.period="month"; @@ -64,10 +63,7 @@ angular.module('DashboardGraphs') .useInteractiveGuideline(true) //We want nice looking tooltips and a guideline! .showLegend(true) //Show the legend, allowing users to turn on/off line series. .showYAxis(true) //Show the y-axis - .showXAxis(true) //Show the x-axis - // .width(width) - // .height(height) - ; + .showXAxis(true); //Show the x-axis var width = $('.graph-container').width(); // nv.utils.windowSize().width/3, @@ -86,13 +82,8 @@ angular.module('DashboardGraphs') d3.select(element.find('svg')[0]) .datum(graphData) - // .attr('width', width) - // .attr('height', height) - // .transition().duration(100) .call(job_status_chart) .style({ - // 'width': width, - // 'height': height, "font-family": 'Open Sans', "font-style": "normal", "font-weight":400, @@ -121,9 +112,6 @@ angular.module('DashboardGraphs') } - var w = angular.element($window); - - angular.element($window).on('resize', function() { adjustGraphSize(job_status_chart, element); }); @@ -136,10 +124,5 @@ angular.module('DashboardGraphs') scope.removeGraphDataReady(); } - scope.removeGraphDataReady = scope.$on('graphDataReady', function (e, data) { - - return job_status_chart; - - }); } }]);