aboutsummaryrefslogtreecommitdiff
path: root/js/src/collapse.js
diff options
context:
space:
mode:
authorPierre Vanduynslager <[email protected]>2017-03-28 17:43:16 -0400
committerJohann-S <[email protected]>2017-03-28 23:43:15 +0200
commit48c5efa4c3c439d8720b8475ec3e372c6974a12a (patch)
tree927c262f444f4aaeb0f598cf35ab7b1b385ae76a /js/src/collapse.js
parentce0e2f8e76dade4b6ec9d6eb541c6988739f0653 (diff)
downloadbootstrap-48c5efa4c3c439d8720b8475ec3e372c6974a12a.tar.xz
bootstrap-48c5efa4c3c439d8720b8475ec3e372c6974a12a.zip
Fix JS components console error "Error: <Component> is transitioning"
Diffstat (limited to 'js/src/collapse.js')
-rw-r--r--js/src/collapse.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/js/src/collapse.js b/js/src/collapse.js
index 6f09fcadd..dc2e2a67d 100644
--- a/js/src/collapse.js
+++ b/js/src/collapse.js
@@ -120,11 +120,8 @@ const Collapse = (($) => {
}
show() {
- if (this._isTransitioning) {
- throw new Error('Collapse is transitioning')
- }
-
- if ($(this._element).hasClass(ClassName.SHOW)) {
+ if (this._isTransitioning ||
+ $(this._element).hasClass(ClassName.SHOW)) {
return
}
@@ -204,11 +201,8 @@ const Collapse = (($) => {
}
hide() {
- if (this._isTransitioning) {
- throw new Error('Collapse is transitioning')
- }
-
- if (!$(this._element).hasClass(ClassName.SHOW)) {
+ if (this._isTransitioning ||
+ !$(this._element).hasClass(ClassName.SHOW)) {
return
}