mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-06 21:56:42 +02:00
fix regression in resetting collapse to auto on collapse open. (+ add spec and rebuild)
This commit is contained in:
2
js/bootstrap-collapse.js
vendored
2
js/bootstrap-collapse.js
vendored
@@ -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)
|
||||
}
|
||||
|
14
js/tests/unit/bootstrap-collapse.js
vendored
14
js/tests/unit/bootstrap-collapse.js
vendored
@@ -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')
|
||||
})
|
||||
|
||||
})
|
Reference in New Issue
Block a user