<script src="../../lib/css.js" data-modules="core accordion"></script>
<script src="../../lib/bootstrap.js" data-widget="accordion"></script>
<style>
- #list, #list1 *, #navigation, #navigation * {
+ #list, #list1 *, #navigation, #navigation *, #collapsible, #collapsible * {
margin: 0;
padding: 0;
font-size: 12px;
line-height: 15px;
}
+ #collapsibleWrapper {
+ width: 300px;
+ float: left;
+ }
</style>
</head>
<body>
</dd>
</dl>
+<div id="collapsibleWrapper">
+ <div id="collapsible">
+ <h3>Header</h3>
+ <div>
+ <p>
+ The calculated height of this accordion should be the same
+ regardless of whether the accordion was collapsed or not
+ when the height was calculated.
+ </p>
+ </div>
+ </div>
+</div>
+
</div>
</body>
</html>
strictEqual( element.accordion( "option", "active" ), 0 );
} );
+// http://bugs.jqueryui.com/ticket/11938
+test( "{ active: false, collapsible: true }", function() {
+ expect( 1 );
+ var element = $( "#collapsible" ).accordion(),
+ height = element.outerHeight();
+
+ element
+ .accordion( "destroy" )
+ .accordion( {
+ active: false,
+ collapsible: true
+ } )
+ .accordion( "option", "active", 0 );
+ equal( element.outerHeight(), height );
+} );
+
test( "{ active: Number }", function() {
expect( 8 );
var element = $( "#list1" ).accordion( {
maxHeight = 0;
this.headers.next()
.each( function() {
+ var isVisible = $( this ).is( ":visible" );
+ if ( !isVisible ) {
+ $( this ).show();
+ }
maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
+ if ( !isVisible ) {
+ $( this ).hide();
+ }
} )
.height( maxHeight );
}