From: fat Date: Wed, 16 Apr 2014 03:28:08 +0000 (-0700) Subject: fixes #11099 - $.collapse() overrides the original dimension of the coll... X-Git-Tag: v3.2.0~240^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd4696f7231cbf6f0478a3bfc1b5c4551e3a290e;p=thirdparty%2Fbootstrap.git fixes #11099 - $.collapse() overrides the original dimension of the coll... --- diff --git a/js/collapse.js b/js/collapse.js index 6f2205b6ff..235b1a9e61 100644 --- a/js/collapse.js +++ b/js/collapse.js @@ -59,7 +59,7 @@ if (e && e.target != this.$element[0]) return this.$element .removeClass('collapsing') - .addClass('collapse in')[dimension]('auto') + .addClass('collapse in')[dimension]('') this.transitioning = 0 this.$element.trigger('shown.bs.collapse') } diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js index bead36f91d..66b2dc1a7e 100644 --- a/js/tests/unit/collapse.js +++ b/js/tests/unit/collapse.js @@ -19,7 +19,7 @@ $(function () { test('should show a collapsed element', function () { var el = $('
').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 reset') }) test('should hide a collapsed element', function () { @@ -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')