mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-30 22:52:24 +01:00
collapse: merge class toggling
This commit is contained in:
parent
b5147ec218
commit
a8887ea8a8
@ -249,12 +249,7 @@ class Collapse extends BaseComponent {
|
||||
}
|
||||
|
||||
for (const element of triggerArray) {
|
||||
if (isOpen) {
|
||||
element.classList.remove(CLASS_NAME_COLLAPSED)
|
||||
} else {
|
||||
element.classList.add(CLASS_NAME_COLLAPSED)
|
||||
}
|
||||
|
||||
element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen)
|
||||
element.setAttribute('aria-expanded', isOpen)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user