0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00

initialize variable properly

This commit is contained in:
GeoSot 2021-06-10 02:35:59 +03:00 committed by XhmikosR
parent 1947ca033e
commit 8fc4f3aaf3

View File

@ -125,7 +125,7 @@ class Collapse extends BaseComponent {
return
}
let actives
let actives = []
let activesData
if (this._parent) {
@ -137,14 +137,10 @@ class Collapse extends BaseComponent {
return elem.classList.contains(CLASS_NAME_COLLAPSE)
})
if (actives.length === 0) {
actives = null
}
}
const container = SelectorEngine.findOne(this._selector)
if (actives) {
if (actives.length) {
const tempActiveData = actives.find(elem => container !== elem)
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null
@ -158,7 +154,6 @@ class Collapse extends BaseComponent {
return
}
if (actives) {
actives.forEach(elemActive => {
if (container !== elemActive) {
Collapse.collapseInterface(elemActive, 'hide')
@ -168,7 +163,6 @@ class Collapse extends BaseComponent {
Data.set(elemActive, DATA_KEY, null)
}
})
}
const dimension = this._getDimension()