From 116e7b211828f76d37f11a493d382582cdd0bde2 Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Mon, 26 Jan 2015 11:11:56 -0500 Subject: [PATCH] Take toolbar height into account on job status graph --- awx/ui/static/js/directives/job-status-graph.js | 6 ++++-- awx/ui/static/partials/job_status_graph.html | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/awx/ui/static/js/directives/job-status-graph.js b/awx/ui/static/js/directives/job-status-graph.js index a2c963544e..1d299c1eba 100644 --- a/awx/ui/static/js/directives/job-status-graph.js +++ b/awx/ui/static/js/directives/job-status-graph.js @@ -36,12 +36,14 @@ angular.module('DashboardGraphs') var w = angular.element($window); function adjustGraphSize() { - var parentHeight = element.parent().height(); + var parentHeight = element.parent().parent().height(); var toolbarHeight = element.find('.toolbar').height(); var container = element.find('svg').parent(); var margins = job_status_chart.margin(); - $(container).height(parentHeight - toolbarHeight - margins.bottom); + var newHeight = parentHeight - toolbarHeight - margins.bottom; + + $(container).height(newHeight); var graph = d3.select(element.find('svg')[0]); var width = parseInt(graph.style('width')) - margins.left - margins.right; diff --git a/awx/ui/static/partials/job_status_graph.html b/awx/ui/static/partials/job_status_graph.html index ec70847709..c57c242b30 100644 --- a/awx/ui/static/partials/job_status_graph.html +++ b/awx/ui/static/partials/job_status_graph.html @@ -1,5 +1,5 @@
-
+
Job Status