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

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2017-09-25 13:41:54 +0300
committerJohann-S <johann.servoire@gmail.com>2017-09-25 14:23:13 +0300
commit9b8356ba52d89fd065d6061979b5946b8c5f44fa (patch)
tree3c78f94c599eb0ba9d052742abb8e8fe5d926fba /js/src/util.js
parent3abf8a0e5525d30914ce37ebb98240a476cb6f17 (diff)
Collapse - Allow to pass jQuery object or DOM element to the parent option
Diffstat (limited to 'js/src/util.js')
-rw-r--r--js/src/util.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/src/util.js b/js/src/util.js
index b18d0f776d..7eb25de558 100644
--- a/js/src/util.js
+++ b/js/src/util.js
@@ -32,10 +32,6 @@ const Util = (() => {
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
}
- function isElement(obj) {
- return (obj[0] || obj).nodeType
- }
-
function getSpecialTransitionEndEvent() {
return {
bindType: transition.end,
@@ -138,12 +134,16 @@ const Util = (() => {
return Boolean(transition)
},
+ isElement(obj) {
+ return (obj[0] || obj).nodeType
+ },
+
typeCheckConfig(componentName, config, configTypes) {
for (const property in configTypes) {
if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
const expectedTypes = configTypes[property]
const value = config[property]
- const valueType = value && isElement(value) ?
+ const valueType = value && Util.isElement(value) ?
'element' : toType(value)
if (!new RegExp(expectedTypes).test(valueType)) {