reflow,
typeCheckConfig
} from './util/index'
-import Data from './dom/data'
import EventHandler from './dom/event-handler'
import Manipulator from './dom/manipulator'
import SelectorEngine from './dom/selector-engine'
.filter(foundElem => foundElem === this._element)
if (selector !== null && filterElement.length) {
- this._selector = selector
this._triggerArray.push(elem)
}
}
return
}
- let actives = []
- let activesData
+ let activeChildren = []
+ // find active children
if (this._config.parent) {
- actives = this._getFirstLevelChildren(SELECTOR_ACTIVES)
+ activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES)
+ .filter(element => element !== this._element)
+ .map(element => Collapse.getOrCreateInstance(element, { toggle: false }))
}
- const container = SelectorEngine.findOne(this._selector)
- if (actives.length) {
- const tempActiveData = actives.find(elem => container !== elem)
- activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null
-
- if (activesData && activesData._isTransitioning) {
- return
- }
+ if (activeChildren.length && activeChildren[0]._isTransitioning) {
+ return
}
const startEvent = EventHandler.trigger(this._element, EVENT_SHOW)
return
}
- for (const elemActive of actives) {
- if (container !== elemActive) {
- Collapse.getOrCreateInstance(elemActive, { toggle: false }).hide()
- }
-
- if (!activesData) {
- Data.set(elemActive, DATA_KEY, null)
- }
+ for (const activeInstance of activeChildren) {
+ activeInstance.hide()
}
const dimension = this._getDimension()