aboutsummaryrefslogtreecommitdiff
path: root/js/bootstrap-collapse.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2012-03-23 18:29:21 -0700
committerMark Otto <[email protected]>2012-03-23 18:29:21 -0700
commitf87e4c60e9bb33f29bffed702af797b322821b8f (patch)
tree64c0663ec3ef31ea3fedd9af6ed10826d10bcbc4 /js/bootstrap-collapse.js
parenta57554222f091ed3905259b32d1f1a3786e37200 (diff)
parentb3bf223617754e658eb62ef0f068732e719a2c82 (diff)
downloadbootstrap-f87e4c60e9bb33f29bffed702af797b322821b8f.tar.xz
bootstrap-f87e4c60e9bb33f29bffed702af797b322821b8f.zip
Merge branch '2.1.0-wip' into 2.0.3-wip
Conflicts: docs/assets/bootstrap.zip
Diffstat (limited to 'js/bootstrap-collapse.js')
-rw-r--r--js/bootstrap-collapse.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js
index 9a364468b..16b91eb24 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('.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')
@@ -56,11 +63,12 @@
this.$element[dimension](0)
this.transition('addClass', 'show', 'shown')
this.$element[dimension](this.$element[0][scroll])
-
}
, 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)
@@ -74,7 +82,7 @@
[dimension](size || 'auto')
[0].offsetWidth
- this.$element[size ? 'addClass' : 'removeClass']('collapse')
+ this.$element[size != null ? 'addClass' : 'removeClass']('collapse')
return this
}
@@ -83,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')