From e2c7fe162d9edd3ebfcdee75efb7ffe313a03be7 Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Sun, 11 Jan 2015 12:56:30 -0500 Subject: [PATCH] Bug 1119243 - The LineGraph should always show the gutter, even if arrows are disabled for tooltips, r=jsantell --- .../devtools/shared/test/browser_graphs-09b.js | 4 ++-- browser/devtools/shared/widgets/Graphs.jsm | 2 +- browser/themes/shared/devtools/widgets.inc.css | 16 ++-------------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/browser/devtools/shared/test/browser_graphs-09b.js b/browser/devtools/shared/test/browser_graphs-09b.js index ab29db4aae1e..7f63a8855a8e 100644 --- a/browser/devtools/shared/test/browser_graphs-09b.js +++ b/browser/devtools/shared/test/browser_graphs-09b.js @@ -31,8 +31,8 @@ function* performTest() { function* testGraph(graph) { yield graph.setDataWhenReady(TEST_DATA); - is(graph._gutter.hidden, true, - "The gutter should be hidden because the tooltips don't have arrows."); + is(graph._gutter.hidden, false, + "The gutter should be visible even if the tooltips don't have arrows."); is(graph._maxTooltip.hidden, false, "The max tooltip should not be hidden."); is(graph._avgTooltip.hidden, false, diff --git a/browser/devtools/shared/widgets/Graphs.jsm b/browser/devtools/shared/widgets/Graphs.jsm index a90fabbd10b1..f7cf01fb1752 100644 --- a/browser/devtools/shared/widgets/Graphs.jsm +++ b/browser/devtools/shared/widgets/Graphs.jsm @@ -1456,7 +1456,7 @@ LineGraphWidget.prototype = Heritage.extend(AbstractCanvasGraph.prototype, { this._maxTooltip.hidden = this._showMax === false || !totalTicks || distanceMinMax < LINE_GRAPH_MIN_MAX_TOOLTIP_DISTANCE; this._avgTooltip.hidden = this._showAvg === false || !totalTicks; this._minTooltip.hidden = this._showMin === false || !totalTicks; - this._gutter.hidden = (this._showMin === false && this._showMax === false) || !totalTicks || !this.withTooltipArrows; + this._gutter.hidden = (this._showMin === false && this._showAvg === false && this._showMax === false) || !totalTicks; this._maxGutterLine.hidden = this._showMax === false; this._avgGutterLine.hidden = this._showAvg === false; diff --git a/browser/themes/shared/devtools/widgets.inc.css b/browser/themes/shared/devtools/widgets.inc.css index 7994046041a4..7e4e7707d8ae 100644 --- a/browser/themes/shared/devtools/widgets.inc.css +++ b/browser/themes/shared/devtools/widgets.inc.css @@ -935,26 +935,14 @@ } .line-graph-widget-tooltip[type=maximum] { - left: -1px; + left: 14px; } .line-graph-widget-tooltip[type=minimum] { - left: -1px; + left: 14px; } .line-graph-widget-tooltip[type=average] { - right: -1px; -} - -.line-graph-widget-tooltip[type=maximum][with-arrows=true] { - left: 14px; -} - -.line-graph-widget-tooltip[type=minimum][with-arrows=true] { - left: 14px; -} - -.line-graph-widget-tooltip[type=average][with-arrows=true] { right: 4px; }