aboutsummaryrefslogtreecommitdiff
path: root/js/src/util.js
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2017-09-25 12:41:54 +0200
committerJohann-S <[email protected]>2017-09-25 13:23:13 +0200
commit9b8356ba52d89fd065d6061979b5946b8c5f44fa (patch)
tree3c78f94c599eb0ba9d052742abb8e8fe5d926fba /js/src/util.js
parent3abf8a0e5525d30914ce37ebb98240a476cb6f17 (diff)
downloadbootstrap-9b8356ba52d89fd065d6061979b5946b8c5f44fa.tar.xz
bootstrap-9b8356ba52d89fd065d6061979b5946b8c5f44fa.zip
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 b18d0f776..7eb25de55 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)) {