1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-28 14:29:07 +02:00

Multiple accordion support (#25161)

This commit is contained in:
Martijn Cuppens
2018-01-03 15:40:58 +01:00
committed by XhmikosR
parent 7044ea82c1
commit a1d134f8a8
2 changed files with 78 additions and 2 deletions

View File

@@ -83,6 +83,7 @@ const Collapse = (($) => {
const elem = tabToggles[i]
const selector = Util.getSelectorFromElement(elem)
if (selector !== null && $(selector).filter(element).length > 0) {
this._selector = selector
this._triggerArray.push(elem)
}
}
@@ -141,7 +142,7 @@ const Collapse = (($) => {
}
if (actives) {
activesData = $(actives).data(DATA_KEY)
activesData = $(actives).not(this._selector).data(DATA_KEY)
if (activesData && activesData._isTransitioning) {
return
}
@@ -154,7 +155,7 @@ const Collapse = (($) => {
}
if (actives) {
Collapse._jQueryInterface.call($(actives), 'hide')
Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide')
if (!activesData) {
$(actives).data(DATA_KEY, null)
}