Commit cb8dcfce authored by Jacob Thornton's avatar Jacob Thornton
Browse files

if transitioning collapse, don't start new transition

parent 663e41d7
2 merge requests!2929Responsive video - from zurp's foundation,!28752.0.3 wip
Showing with 32 additions and 8 deletions
+32 -8
No preview for this file type
......@@ -42,11 +42,18 @@
}
, show: function () {
var dimension = this.dimension()
, scroll = $.camelCase(['scroll', dimension].join('-'))
, actives = this.$parent && this.$parent.find('> .accordion-group > .in')
var dimension
, scroll
, actives
, hasData
if (this.transitioning) return
dimension = this.dimension()
scroll = $.camelCase(['scroll', dimension].join('-'))
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
hasData
if (actives && actives.length) {
hasData = actives.data('collapse')
actives.collapse('hide')
......@@ -59,7 +66,9 @@
}
, hide: function () {
var dimension = this.dimension()
var dimension
if (this.transitioning) return
dimension = this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', 'hide', 'hidden')
this.$element[dimension](0)
......@@ -82,9 +91,12 @@
var that = this
, complete = function () {
if (startEvent == 'show') that.reset()
that.transitioning = 0
that.$element.trigger(completeEvent)
}
this.transitioning = 1
this.$element
.trigger(startEvent)
[method]('in')
......
......@@ -42,11 +42,18 @@
}
, show: function () {
var dimension = this.dimension()
, scroll = $.camelCase(['scroll', dimension].join('-'))
, actives = this.$parent && this.$parent.find('> .accordion-group > .in')
var dimension
, scroll
, actives
, hasData
if (this.transitioning) return
dimension = this.dimension()
scroll = $.camelCase(['scroll', dimension].join('-'))
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
hasData
if (actives && actives.length) {
hasData = actives.data('collapse')
actives.collapse('hide')
......@@ -59,7 +66,9 @@
}
, hide: function () {
var dimension = this.dimension()
var dimension
if (this.transitioning) return
dimension = this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', 'hide', 'hidden')
this.$element[dimension](0)
......@@ -82,9 +91,12 @@
var that = this
, complete = function () {
if (startEvent == 'show') that.reset()
that.transitioning = 0
that.$element.trigger(completeEvent)
}
this.transitioning = 1
this.$element
.trigger(startEvent)
[method]('in')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment