diff --git a/js/jquery.mobile.collapsible.js b/js/jquery.mobile.collapsible.js index 115e83e2b30..3247de4db3c 100644 --- a/js/jquery.mobile.collapsible.js +++ b/js/jquery.mobile.collapsible.js @@ -22,8 +22,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { collapsible = $el.addClass( "ui-collapsible" ), collapsibleHeading = $el.children( o.heading ).first(), collapsibleContent = collapsible.wrapInner( "
" ).find( ".ui-collapsible-content" ), - collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ), - collapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" ); + collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ); // Replace collapsibleHeading if it's a legend if ( collapsibleHeading.is( "legend" ) ) { @@ -62,50 +61,9 @@ $.widget( "mobile.collapsible", $.mobile.widget, { theme: o.theme }); - if ( !collapsibleSet.length ) { - collapsibleHeading - .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) ) - .addClass( "ui-corner-top ui-corner-bottom" ); - } else { - // If we are in a collapsible set - - // Initialize the collapsible set if it's not already initialized - if ( !collapsibleSet.jqmData( "collapsiblebound" ) ) { - - collapsibleSet - .jqmData( "collapsiblebound", true ) - .bind( "expand", function( event ) { - - $( event.target ) - .closest( ".ui-collapsible" ) - .siblings( ".ui-collapsible" ) - .trigger( "collapse" ); - - }); - } - - collapsiblesInSet.first() - .find( "a" ) - .first() - .addClass( "ui-corner-top" ) - .find( ".ui-btn-inner" ) - .addClass( "ui-corner-top" ); - - collapsiblesInSet.last() - .jqmData( "collapsible-last", true ) - .find( "a" ) - .first() - .addClass( "ui-corner-bottom" ) - .find( ".ui-btn-inner" ) - .addClass( "ui-corner-bottom" ); - - - if ( collapsible.jqmData( "collapsible-last" ) ) { - collapsibleHeading - .find( "a" ).first().add ( collapsibleHeading.find( ".ui-btn-inner" ) ) - .addClass( "ui-corner-bottom" ); - } - } + collapsibleHeading + .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) ) + .addClass( "ui-corner-top ui-corner-bottom" ); //events collapsible