From: Tanner Linsley Date: Sat, 13 Jun 2015 06:45:43 +0000 (-0600) Subject: chart.bar - remove tooltip on mouseout X-Git-Tag: 2.0.0-alpha2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=763bde9ed17ab2a828cf03ba707dba4eec4a9dd9;p=thirdparty%2FChart.js.git chart.bar - remove tooltip on mouseout --- diff --git a/src/charts/chart.bar.js b/src/charts/chart.bar.js index 0cc3030a5..358a5fe01 100644 --- a/src/charts/chart.bar.js +++ b/src/charts/chart.bar.js @@ -263,26 +263,26 @@ events: function(e) { - // If exiting chart - if (e.type == 'mouseout') { - return this; - } this.lastActive = this.lastActive || []; // Find Active Elements - this.active = function() { - switch (this.options.hover.mode) { - case 'single': - return this.getElementAtEvent(e); - case 'label': - return this.getElementsAtEvent(e); - case 'dataset': - return this.getDatasetAtEvent(e); - default: - return e; - } - }.call(this); + if (e.type == 'mouseout') { + this.active = []; + } else { + this.active = function() { + switch (this.options.hover.mode) { + case 'single': + return this.getElementAtEvent(e); + case 'label': + return this.getElementsAtEvent(e); + case 'dataset': + return this.getDatasetAtEvent(e); + default: + return e; + } + }.call(this); + } // On Hover hook if (this.options.hover.onHover) {