mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-29 06:49:06 +02:00
Collapse - Allow to pass jQuery object or DOM element to the parent option
This commit is contained in:
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user