Skip to content

Commit

Permalink
Only show tooltip on graph if report count is greater than 0 fixes bu…
Browse files Browse the repository at this point in the history
…g 794637
  • Loading branch information
ossreleasefeed committed Sep 27, 2012
1 parent 91bf382 commit 3417323
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions webapp-php/js/socorro/crash_trends.js
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*global socorro:false, json_path:false, init_ver:false, init_prod:false */
/*global $:false, socorro:false, json_path:false, init_ver:false, init_prod:false */
$(function() {
"use strict";
var fromDate, toDate,
Expand Down Expand Up @@ -220,7 +220,8 @@ $(function() {

$(".crash_stats_body").delegate("#nightly_crash_trends_graph", "plothover", function (event, pos, item) {

var message = "";
var message = "",
reportCount = 0;

if (item) {

Expand All @@ -232,10 +233,13 @@ $(function() {

previousPoint = item.dataIndex;
previousSeriesIndex = item.seriesIndex;
reportCount = item.series.data[previousPoint][0];

message = item.series.data[previousPoint][0] + " total crashes for builds " + previousPoint + " Days old.";

showTooltip(item.pageX - 100, item.pageY - 60, message);
// Only show the tooltip if the report count is more than 0
if(reportCount) {
message = reportCount + " total crashes for builds " + previousPoint + " Days old.";
showTooltip(item.pageX - 100, item.pageY - 60, message);
}
}
} else {
$(".loading").remove();
Expand Down

0 comments on commit 3417323

Please sign in to comment.