Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorDan Dascalescu <ddascalescu+github@gmail.com>2015-07-20 13:57:09 +0300
committerDan Dascalescu <ddascalescu+github@gmail.com>2015-07-20 13:57:09 +0300
commit76882147fe1e688198578c6b682e1d264bb16831 (patch)
tree817266a24b82487676dd3f49e3eb532a75fb0500 /js
parent7572d21930adc304d2cbd8924149e1f07f56ad92 (diff)
Differentiate the className argument from the Element method
Diffstat (limited to 'js')
-rw-r--r--js/piwik.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/piwik.js b/js/piwik.js
index 1903ab216e..ccfb6a4388 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -1384,11 +1384,11 @@ if (typeof Piwik !== 'object') {
return false;
},
- hasNodeCssClass: function (node, className)
+ hasNodeCssClass: function (node, klassName)
{
- if (node && className && 'className' in node && node.className) {
- var classes = node.className.split(' ');
- if (-1 !== indexOfArray(classes, className)) {
+ if (node && klassName && node.className) {
+ var classes = typeof node.className === "string" ? node.className.split(' ') : [];
+ if (-1 !== indexOfArray(classes, klassName)) {
return true;
}
}