actives.forEach(elemActive => {
if (container !== elemActive) {
- Collapse.collapseInterface(elemActive, 'hide')
+ Collapse.getOrCreateInstance(elemActive, { toggle: false }).hide()
}
if (!activesData) {
// Static
- static collapseInterface(element, config) {
- const _config = {}
- if (typeof config === 'string' && /show|hide/.test(config)) {
- _config.toggle = false
- }
-
- const data = Collapse.getOrCreateInstance(element, _config)
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError(`No method named "${config}"`)
+ static jQueryInterface(config) {
+ return this.each(function () {
+ const _config = {}
+ if (typeof config === 'string' && /show|hide/.test(config)) {
+ _config.toggle = false
}
- data[config]()
- }
- }
+ const data = Collapse.getOrCreateInstance(this, _config)
- static jQueryInterface(config) {
- return this.each(function () {
- Collapse.collapseInterface(this, config)
+ if (typeof config === 'string') {
+ if (typeof data[config] === 'undefined') {
+ throw new TypeError(`No method named "${config}"`)
+ }
+
+ data[config]()
+ }
})
}
}