From 6667832392401605b6bd38ffbc5bbd69674aea05 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Sat, 28 May 2016 21:01:10 -0400 Subject: [PATCH] Fix CI & JShint issues --- src/core/core.tooltip.js | 8 ++++---- test/core.tooltip.tests.js | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js index e56ff0ec3..e7abf7229 100644 --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -282,10 +282,10 @@ module.exports = function(Chart) { model.opacity = 1; var labelColors = [], - tooltipPosition = tooltipPosition = getAveragePosition(active); + tooltipPosition = getAveragePosition(active); var tooltipItems = []; - for (var i = 0, len = active.length; i < len; ++i) { + for (i = 0, len = active.length; i < len; ++i) { tooltipItems.push(createTooltipItem(active[i])); } @@ -601,7 +601,7 @@ module.exports = function(Chart) { var bodyColor = helpers.color(vm.bodyColor); var textColor = bodyColor.alpha(opacity * bodyColor.alpha()).rgbString(); - ctx.fillStyle = textColor + ctx.fillStyle = textColor; ctx.font = helpers.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily); // Before Body @@ -615,7 +615,7 @@ module.exports = function(Chart) { helpers.each(vm.beforeBody, fillLineOfText); var drawColorBoxes = body.length > 1; - xLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0 + xLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0; // Draw body lines now helpers.each(body, function(bodyItem, i) { diff --git a/test/core.tooltip.tests.js b/test/core.tooltip.tests.js index 8c852d76f..f9fa04b38 100644 --- a/test/core.tooltip.tests.js +++ b/test/core.tooltip.tests.js @@ -119,8 +119,8 @@ describe('tooltip tests', function() { }] })); - expect(tooltip._view.x).toBeCloseTo(269, 1); - expect(tooltip._view.y).toBeCloseTo(155, 1); + expect(tooltip._view.x).toBeCloseTo(269, 0); + expect(tooltip._view.y).toBeCloseTo(155, 0); }); it('Should display in single mode', function() { @@ -223,8 +223,8 @@ describe('tooltip tests', function() { labelColors: [] })); - expect(tooltip._view.x).toBeCloseTo(269, 1); - expect(tooltip._view.y).toBeCloseTo(312, 1); + expect(tooltip._view.x).toBeCloseTo(269, 0); + expect(tooltip._view.y).toBeCloseTo(312, 0); }); it('Should display information from user callbacks', function() { @@ -372,8 +372,8 @@ describe('tooltip tests', function() { }] })); - expect(tooltip._view.x).toBeCloseTo(216, 1); - expect(tooltip._view.y).toBeCloseTo(190, 1); + expect(tooltip._view.x).toBeCloseTo(216, 0); + expect(tooltip._view.y).toBeCloseTo(190, 0); }); it('Should display information from user callbacks', function() { @@ -455,7 +455,7 @@ describe('tooltip tests', function() { }] })); - expect(tooltip._view.x).toBeCloseTo(269, 1); - expect(tooltip._view.y).toBeCloseTo(155, 1); + expect(tooltip._view.x).toBeCloseTo(269, 0); + expect(tooltip._view.y).toBeCloseTo(155, 0); }); });