2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-17 19:21:23 +03:00

Don't fire show event if show is prevented because other element is still transitioning

Fixes #14844.
Closes #14845.
This commit is contained in:
Heinrich Fenkart
2014-10-22 03:49:03 +02:00
parent a096c3f6f6
commit e811a24118
2 changed files with 44 additions and 5 deletions
+9 -5
View File
@@ -38,17 +38,21 @@
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
if (actives && actives.length) {
activesData = actives.data('bs.collapse')
if (activesData && activesData.transitioning) return
}
var startEvent = $.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
if (actives && actives.length) {
var hasData = actives.data('bs.collapse')
if (hasData && hasData.transitioning) return
Plugin.call(actives, 'hide')
hasData || actives.data('bs.collapse', null)
activesData || actives.data('bs.collapse', null)
}
var dimension = this.dimension()