diff --git a/README.md b/README.md index e843212..f7aa397 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ In comments there are default values If you wish to contribute, please do so by editing the jquery.flot.tooltip.source.js file. The other .js files are built with Grunt and should not be directly edited. When working with external plugin support, you can use the array plotPlugins (via this.plotPlugins), which is a collection of the names of the currently loaded Flot plugins. For instance if checking for the existance of the official -symbol plugin, you would check `if ($.inArray(this.plotPlugins, 'symbol') !== -1)`. +symbol plugin, you would check `if ($.inArray('symbol', this.plotPlugins) !== -1)`. There exists a Gruntfile.js for development purposes, but please do not commit built production or minified .js files when making a pull request. Additionally, do not change the version, because the new version could vary depending on when the pull request is merged and how many other changes were made at the same time. diff --git a/js/jquery.flot.tooltip.js b/js/jquery.flot.tooltip.js index 8c2e11f..b00de49 100644 --- a/js/jquery.flot.tooltip.js +++ b/js/jquery.flot.tooltip.js @@ -464,12 +464,12 @@ // check if flot-axislabels plugin (https://github.com/markrcote/flot-axislabels) is used and that an axis label is given FlotTooltip.prototype.hasAxisLabel = function (axisName, item) { - return ($.inArray(this.plotPlugins, 'axisLabels') !== -1 && typeof item.series[axisName].options.axisLabel !== 'undefined' && item.series[axisName].options.axisLabel.length > 0); + return ($.inArray('axisLabels', this.plotPlugins) !== -1 && typeof item.series[axisName].options.axisLabel !== 'undefined' && item.series[axisName].options.axisLabel.length > 0); }; // check whether flot-tickRotor, a plugin which allows rotation of X-axis ticks, is being used FlotTooltip.prototype.hasRotatedXAxisTicks = function (item) { - return ($.inArray(this.plotPlugins, 'tickRotor') !== -1 && typeof item.series.xaxis.rotatedTicks !== 'undefined'); + return ($.inArray('tickRotor', this.plotPlugins) !== -1 && typeof item.series.xaxis.rotatedTicks !== 'undefined'); }; //