const Selector = {
ACTIVES : '.card > .show, .card > .collapsing',
- DATA_TOGGLE : '[data-toggle="collapse"]'
+ DATA_TOGGLE : '[data-toggle="collapse"]',
+ DATA_CHILDREN : 'data-children'
}
this._addAriaAndCollapsedClass(this._element, this._triggerArray)
}
+ this._selectorActives = Selector.ACTIVES
+ if (this._parent) {
+ const childrenSelector = this._parent.hasAttribute(Selector.DATA_CHILDREN) ? this._parent.getAttribute(Selector.DATA_CHILDREN) : null
+ if (childrenSelector !== null) {
+ this._selectorActives = childrenSelector + ' > .show, ' + childrenSelector + ' > .collapsing'
+ }
+ }
+
if (this._config.toggle) {
this.toggle()
}
let activesData
if (this._parent) {
- actives = $.makeArray($(this._parent).find(Selector.ACTIVES))
+ actives = $.makeArray($(this._parent).find(this._selectorActives))
if (!actives.length) {
actives = null
}