From 34173239bfced82dfec3589281869e25b98a1241 Mon Sep 17 00:00:00 2001 From: ossreleasefeed Date: Thu, 27 Sep 2012 10:30:27 +0200 Subject: [PATCH] Only show tooltip on graph if report count is greater than 0 fixes bug 794637 --- webapp-php/js/socorro/crash_trends.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/webapp-php/js/socorro/crash_trends.js b/webapp-php/js/socorro/crash_trends.js index e57bc8614a..6bf2985618 100644 --- a/webapp-php/js/socorro/crash_trends.js +++ b/webapp-php/js/socorro/crash_trends.js @@ -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, @@ -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) { @@ -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();