]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
if transitioning collapse, don't start new transition
authorJacob Thornton <jacobthornton@gmail.com>
Wed, 21 Mar 2012 05:43:27 +0000 (22:43 -0700)
committerJacob Thornton <jacobthornton@gmail.com>
Wed, 21 Mar 2012 05:43:27 +0000 (22:43 -0700)
docs/assets/bootstrap.zip
docs/assets/js/bootstrap-collapse.js
js/bootstrap-collapse.js

index b23cd19c97c6bb27c4f5eddcd364037cb2abf7d8..60cf1993b8944f2cee445870592add3c1f66f0e1 100644 (file)
Binary files a/docs/assets/bootstrap.zip and b/docs/assets/bootstrap.zip differ
index 2dbf7a7617d8161cc632f2f50f0fe1cc3b1bd321..16b91eb2441eb56be3b98cfa4139a37356d7f11d 100644 (file)
     }
 
   , 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)
       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')
index 2dbf7a7617d8161cc632f2f50f0fe1cc3b1bd321..16b91eb2441eb56be3b98cfa4139a37356d7f11d 100644 (file)
     }
 
   , 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)
       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')