aboutsummaryrefslogtreecommitdiff
path: root/js/src/collapse.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/collapse.js')
-rw-r--r--js/src/collapse.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/js/src/collapse.js b/js/src/collapse.js
index ebc3e24cf..1e4730ff7 100644
--- a/js/src/collapse.js
+++ b/js/src/collapse.js
@@ -112,8 +112,11 @@ const Collapse = (($) => {
}
show() {
- if (this._isTransitioning ||
- $(this._element).hasClass(ClassName.ACTIVE)) {
+ if (this._isTransitioning) {
+ throw new Error('Collapse is transitioning')
+ }
+
+ if ($(this._element).hasClass(ClassName.ACTIVE)) {
return
}
@@ -193,8 +196,11 @@ const Collapse = (($) => {
}
hide() {
- if (this._isTransitioning ||
- !$(this._element).hasClass(ClassName.ACTIVE)) {
+ if (this._isTransitioning) {
+ throw new Error('Collapse is transitioning')
+ }
+
+ if (!$(this._element).hasClass(ClassName.ACTIVE)) {
return
}