]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix CI & JShint issues
authorEvert Timberg <evert.timberg+github@gmail.com>
Sun, 29 May 2016 01:01:10 +0000 (21:01 -0400)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sun, 29 May 2016 01:01:10 +0000 (21:01 -0400)
src/core/core.tooltip.js
test/core.tooltip.tests.js

index e56ff0ec3f24a53bc1db49a2bcbb02ef3b96e06b..e7abf722940c6c176f3fdc7280c1ad76767929bf 100644 (file)
@@ -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) {
index 8c852d76feec2a4eb27bce60b18bd300d605a8b1..f9fa04b38a426216eee72d38a3e6b32a9528f4c7 100644 (file)
@@ -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);
        });
 });