diff options
Diffstat (limited to 'js')
| -rw-r--r-- | js/bootstrap-collapse.js | 2 | ||||
| -rw-r--r-- | js/tests/unit/bootstrap-collapse.js | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js index 4cd412c73..d02f6fda4 100644 --- a/js/bootstrap-collapse.js +++ b/js/bootstrap-collapse.js @@ -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) } diff --git a/js/tests/unit/bootstrap-collapse.js b/js/tests/unit/bootstrap-collapse.js index 8e52898b5..fb66135db 100644 --- a/js/tests/unit/bootstrap-collapse.js +++ b/js/tests/unit/bootstrap-collapse.js @@ -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') + }) + })
\ No newline at end of file |
