2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-14 18:42:30 +03:00

collapse: merge class toggling

This commit is contained in:
GeoSot
2021-11-02 16:40:34 +02:00
committed by XhmikosR
parent b5147ec218
commit a8887ea8a8
+1 -6
View File
@@ -249,12 +249,7 @@ class Collapse extends BaseComponent {
} }
for (const element of triggerArray) { for (const element of triggerArray) {
if (isOpen) { element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen)
element.classList.remove(CLASS_NAME_COLLAPSED)
} else {
element.classList.add(CLASS_NAME_COLLAPSED)
}
element.setAttribute('aria-expanded', isOpen) element.setAttribute('aria-expanded', isOpen)
} }
} }