From 76e4626fbe3bb1d92ee29947e1b5f839e4379d4d Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 9 Jun 2015 20:19:16 -0400 Subject: [PATCH] Adjusting tooltips for job detail donut chart for better mouse movement, adding an offset based on the charts dimensions --- awx/ui/static/js/helpers/JobDetail.js | 7 +++++-- awx/ui/static/less/job-details.less | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/awx/ui/static/js/helpers/JobDetail.js b/awx/ui/static/js/helpers/JobDetail.js index 97a09ae8f6..039c90bc8c 100644 --- a/awx/ui/static/js/helpers/JobDetail.js +++ b/awx/ui/static/js/helpers/JobDetail.js @@ -1281,8 +1281,11 @@ export default }); path.on('mousemove', function() { - tooltip.style('top', (d3.mouse(this)[0]+200) + 'px') - .style('left', (d3.mouse(this)[0]+200) + 'px'); + // d3.mouse() gives the coordinates of hte mouse, then add + // some offset to provide breathing room for hte tooltip + // based on the dimensions of the donut + tooltip.style('top', (d3.mouse(this)[1] + (height/5) + 'px')) + .style('left', (d3.mouse(this)[0] + (width/3) + 'px')); }); legend = svg.selectAll('.legend') diff --git a/awx/ui/static/less/job-details.less b/awx/ui/static/less/job-details.less index f95b6ec260..d24c9f22e8 100644 --- a/awx/ui/static/less/job-details.less +++ b/awx/ui/static/less/job-details.less @@ -510,7 +510,7 @@ position: absolute; text-align: center; top: 85px; - width: 80px; + width: 100px; z-index: 10; color: white; background-color: black !important;