Skip to content

Commit

Permalink
fix regression in resetting collapse to auto on collapse open. (+ add…
Browse files Browse the repository at this point in the history
… spec and rebuild)
  • Loading branch information
fat committed Apr 25, 2012
1 parent 66ac6e1 commit aaabe2a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/assets/css/bootstrap.css
Expand Up @@ -4651,15 +4651,15 @@ a.badge:hover {
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: width 0.6s ease;
-moz-transition: width 0.6s ease;
-ms-transition: width 0.6s ease;
-o-transition: width 0.6s ease;
transition: width 0.6s ease;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}

.progress-striped .bar {
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/bootstrap-collapse.js
Expand Up @@ -95,7 +95,7 @@
, transition: function (method, startEvent, completeEvent) {
var that = this
, complete = function () {
if (startEvent == 'show') that.reset()
if (startEvent.type == 'show') that.reset()
that.transitioning = 0
that.$element.trigger(completeEvent)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/bootstrap.js
Expand Up @@ -507,7 +507,7 @@
, transition: function (method, startEvent, completeEvent) {
var that = this
, complete = function () {
if (startEvent == 'show') that.reset()
if (startEvent.type == 'show') that.reset()
that.transitioning = 0
that.$element.trigger(completeEvent)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/bootstrap.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/bootstrap-collapse.js
Expand Up @@ -95,7 +95,7 @@
, transition: function (method, startEvent, completeEvent) {
var that = this
, complete = function () {
if (startEvent == 'show') that.reset()
if (startEvent.type == 'show') that.reset()
that.transitioning = 0
that.$element.trigger(completeEvent)
}
Expand Down
14 changes: 14 additions & 0 deletions js/tests/unit/bootstrap-collapse.js
Expand Up @@ -37,4 +37,18 @@ $(function () {
.collapse('show')
})

test("should reset style to auto after finishing opening collapse", function () {
$.support.transition = false
stop();
$('<div class="collapse" style="height: 0px"/>')
.bind('show', function () {
ok(this.style.height == '0px')
})
.bind('shown', function () {
ok(this.style.height == 'auto')
start()
})
.collapse('show')
})

})

0 comments on commit aaabe2a

Please sign in to comment.