Skip to content

Commit

Permalink
fixes #11099 - $.collapse() overrides the original dimension of the c…
Browse files Browse the repository at this point in the history
…ollapsed element when uncollapsing
  • Loading branch information
fat committed Apr 9, 2014
1 parent b3f30bb commit 5da0bf0
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
this.$element
.removeClass('collapsing')
.addClass('collapse in')
[dimension]('auto')
[dimension]('')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
}
Expand Down
2 changes: 1 addition & 1 deletion dist/js/bootstrap.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/js/customize.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/js/raw-files.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/js/bootstrap.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
this.$element
.removeClass('collapsing')
.addClass('collapse in')
[dimension]('auto')
[dimension]('')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
}
Expand Down
4 changes: 2 additions & 2 deletions js/tests/unit/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $(function () {
test('should show a collapsed element', function () {
var el = $('<div class="collapse"></div>').collapse('show')
ok(el.hasClass('in'), 'has class in')
ok(/height/.test(el.attr('style')), 'has height set')
ok(!/height/.test(el.attr('style')), 'has height set')
})

test('should hide a collapsed element', function () {
Expand Down Expand Up @@ -51,7 +51,7 @@ $(function () {
ok(this.style.height == '0px')
})
.on('shown.bs.collapse', function () {
ok(this.style.height == 'auto')
ok(this.style.height === '')
start()
})
.collapse('show')
Expand Down

0 comments on commit 5da0bf0

Please sign in to comment.