mirror of
https://github.com/twbs/bootstrap.git
synced 2025-03-02 02:29:24 +01:00
collapse.js: minor refactoring.
This commit is contained in:
parent
1393678f0b
commit
3ffe3a5d82
@ -305,17 +305,15 @@ class Collapse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getParent() {
|
_getParent() {
|
||||||
let parent
|
let { parent } = this._config
|
||||||
|
|
||||||
if (isElement(this._config.parent)) {
|
|
||||||
{ parent } = this._config
|
|
||||||
|
|
||||||
|
if (isElement(parent)) {
|
||||||
// it's a jQuery object
|
// it's a jQuery object
|
||||||
if (typeof this._config.parent.jquery !== 'undefined' || typeof this._config.parent[0] !== 'undefined') {
|
if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') {
|
||||||
parent = this._config.parent[0]
|
parent = parent[0]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parent = SelectorEngine.findOne(this._config.parent)
|
parent = SelectorEngine.findOne(parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
const selector = `[data-toggle="collapse"][data-parent="${parent}"]`
|
const selector = `[data-toggle="collapse"][data-parent="${parent}"]`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user