Skip to content

Commit

Permalink
Merge pull request #13330 from Kronuz/patch-1
Browse files Browse the repository at this point in the history
Wait for the expected target during a collapse
  • Loading branch information
cvrebert committed Apr 16, 2014
2 parents 1254c32 + 82b066f commit d08f7dd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions js/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit d08f7dd

Please sign in to comment.