diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-08-21 13:35:08 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-08-24 09:44:55 +0200 |
commit | e03af5c4693fea777b70b667abbdac47a9f48aa8 (patch) | |
tree | b79acf3e94226c5ced9ec35ff70874ca93b1cc38 /server/sonar-web/src/main/js/libs | |
parent | 7a65a44016c32c5656e7aa5f0e174e670b6849b0 (diff) | |
download | sonarqube-e03af5c4693fea777b70b667abbdac47a9f48aa8.tar.gz sonarqube-e03af5c4693fea777b70b667abbdac47a9f48aa8.zip |
SONAR-6690 update the style of select list component
Diffstat (limited to 'server/sonar-web/src/main/js/libs')
-rw-r--r-- | server/sonar-web/src/main/js/libs/third-party/classNames.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/libs/third-party/classNames.js b/server/sonar-web/src/main/js/libs/third-party/classNames.js new file mode 100644 index 00000000000..afb8eed33a7 --- /dev/null +++ b/server/sonar-web/src/main/js/libs/third-party/classNames.js @@ -0,0 +1,49 @@ +/*! + Copyright (c) 2015 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ + +(function () { + 'use strict'; + + function classNames () { + + var classes = ''; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if ('string' === argType || 'number' === argType) { + classes += ' ' + arg; + + } else if (Array.isArray(arg)) { + classes += ' ' + classNames.apply(null, arg); + + } else if ('object' === argType) { + for (var key in arg) { + if (arg.hasOwnProperty(key) && arg[key]) { + classes += ' ' + key; + } + } + } + } + + return classes.substr(1); + } + + if (typeof module !== 'undefined' && module.exports) { + module.exports = classNames; + } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd){ + // AMD. Register as an anonymous module. + define(function () { + return classNames; + }); + } else { + window.classNames = classNames; + } + +}()); |