Skip to content

Commit aaabe2a

Browse files
committed
fix regression in resetting collapse to auto on collapse open. (+ add spec and rebuild)
1 parent 66ac6e1 commit aaabe2a

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

docs/assets/css/bootstrap.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4651,15 +4651,15 @@ a.badge:hover {
46514651
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
46524652
-moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
46534653
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
4654+
-webkit-box-sizing: border-box;
4655+
-moz-box-sizing: border-box;
4656+
-ms-box-sizing: border-box;
4657+
box-sizing: border-box;
46544658
-webkit-transition: width 0.6s ease;
46554659
-moz-transition: width 0.6s ease;
46564660
-ms-transition: width 0.6s ease;
46574661
-o-transition: width 0.6s ease;
46584662
transition: width 0.6s ease;
4659-
-webkit-box-sizing: border-box;
4660-
-moz-box-sizing: border-box;
4661-
-ms-box-sizing: border-box;
4662-
box-sizing: border-box;
46634663
}
46644664

46654665
.progress-striped .bar {

docs/assets/js/bootstrap-collapse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
, transition: function (method, startEvent, completeEvent) {
9696
var that = this
9797
, complete = function () {
98-
if (startEvent == 'show') that.reset()
98+
if (startEvent.type == 'show') that.reset()
9999
that.transitioning = 0
100100
that.$element.trigger(completeEvent)
101101
}

docs/assets/js/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@
507507
, transition: function (method, startEvent, completeEvent) {
508508
var that = this
509509
, complete = function () {
510-
if (startEvent == 'show') that.reset()
510+
if (startEvent.type == 'show') that.reset()
511511
that.transitioning = 0
512512
that.$element.trigger(completeEvent)
513513
}

docs/assets/js/bootstrap.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/bootstrap-collapse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
, transition: function (method, startEvent, completeEvent) {
9696
var that = this
9797
, complete = function () {
98-
if (startEvent == 'show') that.reset()
98+
if (startEvent.type == 'show') that.reset()
9999
that.transitioning = 0
100100
that.$element.trigger(completeEvent)
101101
}

js/tests/unit/bootstrap-collapse.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,18 @@ $(function () {
3737
.collapse('show')
3838
})
3939

40+
test("should reset style to auto after finishing opening collapse", function () {
41+
$.support.transition = false
42+
stop();
43+
$('<div class="collapse" style="height: 0px"/>')
44+
.bind('show', function () {
45+
ok(this.style.height == '0px')
46+
})
47+
.bind('shown', function () {
48+
ok(this.style.height == 'auto')
49+
start()
50+
})
51+
.collapse('show')
52+
})
53+
4054
})

0 commit comments

Comments
 (0)