mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
fix regression in resetting collapse to auto on collapse open. (+ add spec and rebuild)
This commit is contained in:
parent
66ac6e14db
commit
aaabe2a46c
6 changed files with 22 additions and 8 deletions
8
docs/assets/css/bootstrap.css
vendored
8
docs/assets/css/bootstrap.css
vendored
|
@ -4651,15 +4651,15 @@ a.badge:hover {
|
||||||
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
|
-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);
|
-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);
|
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;
|
-webkit-transition: width 0.6s ease;
|
||||||
-moz-transition: width 0.6s ease;
|
-moz-transition: width 0.6s ease;
|
||||||
-ms-transition: width 0.6s ease;
|
-ms-transition: width 0.6s ease;
|
||||||
-o-transition: width 0.6s ease;
|
-o-transition: width 0.6s ease;
|
||||||
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 {
|
.progress-striped .bar {
|
||||||
|
|
2
docs/assets/js/bootstrap-collapse.js
vendored
2
docs/assets/js/bootstrap-collapse.js
vendored
|
@ -95,7 +95,7 @@
|
||||||
, transition: function (method, startEvent, completeEvent) {
|
, transition: function (method, startEvent, completeEvent) {
|
||||||
var that = this
|
var that = this
|
||||||
, complete = function () {
|
, complete = function () {
|
||||||
if (startEvent == 'show') that.reset()
|
if (startEvent.type == 'show') that.reset()
|
||||||
that.transitioning = 0
|
that.transitioning = 0
|
||||||
that.$element.trigger(completeEvent)
|
that.$element.trigger(completeEvent)
|
||||||
}
|
}
|
||||||
|
|
2
docs/assets/js/bootstrap.js
vendored
2
docs/assets/js/bootstrap.js
vendored
|
@ -507,7 +507,7 @@
|
||||||
, transition: function (method, startEvent, completeEvent) {
|
, transition: function (method, startEvent, completeEvent) {
|
||||||
var that = this
|
var that = this
|
||||||
, complete = function () {
|
, complete = function () {
|
||||||
if (startEvent == 'show') that.reset()
|
if (startEvent.type == 'show') that.reset()
|
||||||
that.transitioning = 0
|
that.transitioning = 0
|
||||||
that.$element.trigger(completeEvent)
|
that.$element.trigger(completeEvent)
|
||||||
}
|
}
|
||||||
|
|
2
docs/assets/js/bootstrap.min.js
vendored
2
docs/assets/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
2
js/bootstrap-collapse.js
vendored
2
js/bootstrap-collapse.js
vendored
|
@ -95,7 +95,7 @@
|
||||||
, transition: function (method, startEvent, completeEvent) {
|
, transition: function (method, startEvent, completeEvent) {
|
||||||
var that = this
|
var that = this
|
||||||
, complete = function () {
|
, complete = function () {
|
||||||
if (startEvent == 'show') that.reset()
|
if (startEvent.type == 'show') that.reset()
|
||||||
that.transitioning = 0
|
that.transitioning = 0
|
||||||
that.$element.trigger(completeEvent)
|
that.$element.trigger(completeEvent)
|
||||||
}
|
}
|
||||||
|
|
14
js/tests/unit/bootstrap-collapse.js
vendored
14
js/tests/unit/bootstrap-collapse.js
vendored
|
@ -37,4 +37,18 @@ $(function () {
|
||||||
.collapse('show')
|
.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')
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
Loading…
Reference in a new issue