aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermán M. Bravo <[email protected]>2014-04-12 14:44:35 -0500
committerGermán M. Bravo <[email protected]>2014-04-12 14:44:35 -0500
commit82b066f0a91b6ff0fb5e49b43382dd44d0f35134 (patch)
tree147811393623ac9521f24e638da893dfc6832b8b
parentee7498a69366c516ccba01ca7c977fb83ea23a7b (diff)
downloadbootstrap-82b066f0a91b6ff0fb5e49b43382dd44d0f35134.tar.xz
bootstrap-82b066f0a91b6ff0fb5e49b43382dd44d0f35134.zip
Wait for the expected target during a collapse
Actually wait for the collapsed item to complete. If complete is called with other target, instead of simply returning and do nothing, wait again until the proper target triggers the event (otherwise this leaves collapse in a broken state).
-rw-r--r--js/collapse.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/collapse.js b/js/collapse.js
index 6f2205b6f..42563c08e 100644
--- a/js/collapse.js
+++ b/js/collapse.js
@@ -56,7 +56,11 @@
this.transitioning = 1
var complete = function (e) {
- if (e && e.target != this.$element[0]) return
+ if (e && e.target != this.$element[0]) {
+ this.$element
+ .one($.support.transition.end, $.proxy(complete, this))
+ return
+ }
this.$element
.removeClass('collapsing')
.addClass('collapse in')[dimension]('auto')
@@ -92,7 +96,11 @@
this.transitioning = 1
var complete = function (e) {
- if (e && e.target != this.$element[0]) return
+ if (e && e.target != this.$element[0]) {
+ this.$element
+ .one($.support.transition.end, $.proxy(complete, this))
+ return
+ }
this.transitioning = 0
this.$element
.trigger('hidden.bs.collapse')