Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2012-03-21 09:43:27 +0400
committerJacob Thornton <jacobthornton@gmail.com>2012-03-21 09:43:27 +0400
commitcb8dcfcebfbbd8f2ea26b786b44992f00d35ac30 (patch)
treea76f78498eb733a9785d23b7464dfbea94d313dc /js/bootstrap-collapse.js
parent663e41d74f6369812da29a1dd66b0b1fcfd22827 (diff)
if transitioning collapse, don't start new transition
Diffstat (limited to 'js/bootstrap-collapse.js')
-rw-r--r--js/bootstrap-collapse.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js
index 2dbf7a7617..16b91eb244 100644
--- a/js/bootstrap-collapse.js
+++ b/js/bootstrap-collapse.js
@@ -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')