Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

jslint fixes

  • Loading branch information...
commit af84c9970f1c5226e96cd43b6885782f0de55642 1 parent c0b4885
@eolsson eolsson authored
View
14 js/adapters/mootools-adapter.src.js
@@ -15,7 +15,7 @@
var win = window,
legacy = !!win.$merge,
$extend = win.$extend || function() {
- return Object.append.apply(Object, arguments)
+ return Object.append.apply(Object, arguments);
};
win.HighchartsAdapter = {
@@ -81,7 +81,7 @@ win.HighchartsAdapter = {
el.setStyle = function() { // property value is given as array in Moo - break it down
var args = arguments;
el.attr.call(el, args[0], args[1][0]);
- }
+ };
// dirty hack to trick Moo into handling el as an element wrapper
el.$family = el.uid = true;
}
@@ -170,9 +170,9 @@ win.HighchartsAdapter = {
* @param {Function} fn Event handler
*/
addEvent: function (el, type, fn) {
- if (typeof type == 'string') { // chart broke due to el being string, type function
+ if (typeof type === 'string') { // chart broke due to el being string, type function
- if (type == 'unload') { // Moo self destructs before custom unload events
+ if (type === 'unload') { // Moo self destructs before custom unload events
type = 'beforeunload';
}
@@ -192,7 +192,7 @@ win.HighchartsAdapter = {
removeEvent: function(el, type, fn) {
if (type) {
- if (type == 'unload') { // Moo self destructs before custom unload events
+ if (type === 'unload') { // Moo self destructs before custom unload events
type = 'beforeunload';
}
@@ -238,6 +238,6 @@ win.HighchartsAdapter = {
el.fx.cancel();
}
}
-}
+};
-})();
+}());
View
17 js/adapters/prototype-adapter.src.js
@@ -20,7 +20,7 @@
// Adapter interface between prototype and the Highcarts charting library
var HighchartsAdapter = (function() {
-var hasEffect = typeof Effect != 'undefined';
+var hasEffect = typeof Effect !== 'undefined';
return {
@@ -44,7 +44,7 @@ return {
from = element.attr(attr);
// special treatment for paths
- if (attr == 'd') {
+ if (attr === 'd') {
this.paths = Highcharts.pathAnim.init(
element,
element.d,
@@ -234,11 +234,11 @@ return {
},*/
merge: function() { // the built-in prototype merge function doesn't do deep copy
function doCopy(copy, original) {
- var value;
+ var value, key;
- for (var key in original) {
+ for (key in original) {
value = original[key];
- if (value && typeof value == 'object' && value.constructor != Array &&
+ if (value && typeof value === 'object' && value.constructor !== Array &&
typeof value.nodeType !== 'number') {
copy[key] = doCopy(copy[key] || {}, value); // copy
@@ -251,10 +251,11 @@ return {
function merge() {
var args = arguments,
+ i,
retVal = {};
- for (var i = 0; i < args.length; i++) {
- retVal = doCopy(retVal, args[i])
+ for (i = 0; i < args.length; i++) {
+ retVal = doCopy(retVal, args[i]);
}
return retVal;
@@ -298,4 +299,4 @@ return {
}
}
};
-})();
+}());
View
14 js/modules/exporting.src.js
@@ -26,7 +26,7 @@ var HC = Highcharts,
mathMax = math.max,
doc = document,
win = window,
- hasTouch = 'ontouchstart' in doc.documentElement,
+ hasTouch = doc.documentElement.ontouchstart !== undefined,
M = 'M',
L = 'L',
DIV = 'div',
@@ -35,7 +35,7 @@ var HC = Highcharts,
PREFIX = 'highcharts-',
ABSOLUTE = 'absolute',
PX = 'px',
- UNDEFINED = undefined,
+ UNDEFINED,
// Add language and get the defaultOptions
defaultOptions = HC.setOptions({
@@ -243,7 +243,7 @@ extend(Chart.prototype, {
name: point.name
};
- if (typeof config == 'object' && point.config && config.constructor != Array) {
+ if (typeof config === 'object' && point.config && config.constructor !== Array) {
extend(pointOptions, config);
}
@@ -321,7 +321,7 @@ extend(Chart.prototype, {
// IE9 beta bugs with innerHTML. Test again with final IE9.
svg = svg.replace(/(url\(#highcharts-[0-9]+)&quot;/g, '$1')
.replace(/&quot;/g, "'");
- if (svg.match(/ xmlns="/g).length == 2) {
+ if (svg.match(/ xmlns="/g).length === 2) {
svg = svg.replace(/xmlns="[^"]+"/, '');
}
@@ -390,7 +390,7 @@ extend(Chart.prototype, {
// hide all body content
each(childNodes, function(node, i) {
- if (node.nodeType == 1) {
+ if (node.nodeType === 1) {
origDisplay[i] = node.style.display;
node.style.display = NONE;
}
@@ -410,7 +410,7 @@ extend(Chart.prototype, {
// restore all body content
each(childNodes, function(node, i) {
- if (node.nodeType == 1) {
+ if (node.nodeType === 1) {
node.style.display = origDisplay[i];
}
});
@@ -700,4 +700,4 @@ Chart.prototype.callbacks.push(function(chart) {
});
-})();
+}());
Please sign in to comment.
Something went wrong with that request. Please try again.