collapse graph area if there are no fails

If there are no actual fails, we shouldn't show the graph area at all,
this makes the page smaller length wise. As an additional hint that
there is nothing to see here for the no hit bugs, set the div opacity
to 0.5 to make them fade away a bit.

Change-Id: I0e06d4df4de3e2d726c58e21aa9aa0d011d36510
This commit is contained in:
Sean Dague 2014-09-27 08:19:19 -04:00
parent 325cc32e18
commit 032cce34fd
1 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,7 @@ function graphite_hit_count(job, color) {
function update_graph_for_bug(main, bug) {
var div = main.find("#bug-" + bug['number'] + " .graph");
if (bug['data'].length > 0) {
if (bug['fails'] > 0) {
$.plot(div, bug['data'],
{xaxis: {
mode: "time"
@ -39,6 +39,8 @@ function update_graph_for_bug(main, bug) {
);
} else {
div.html("No matches");
div.css('height', 'auto');
div.parent().css('opacity', '0.5');
}
}