diff options
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/collapse.js | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/js/src/collapse.js b/js/src/collapse.js index 68046e1a6b..8894342dfc 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -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) } } |