return
}
- let actives
+ let actives = []
let activesData
if (this._parent) {
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
return
}
- if (actives) {
- actives.forEach(elemActive => {
- if (container !== elemActive) {
- Collapse.collapseInterface(elemActive, 'hide')
- }
+ actives.forEach(elemActive => {
+ if (container !== elemActive) {
+ Collapse.collapseInterface(elemActive, 'hide')
+ }
- if (!activesData) {
- Data.set(elemActive, DATA_KEY, null)
- }
- })
- }
+ if (!activesData) {
+ Data.set(elemActive, DATA_KEY, null)
+ }
+ })
const dimension = this._getDimension()