Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Renamed variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghislain Seguin committed Nov 10, 2011
1 parent d5ab078 commit 94389bd
Showing 1 changed file with 4 additions and 46 deletions.
50 changes: 4 additions & 46 deletions js/jquery.mobile.collapsible.js
Expand Up @@ -22,8 +22,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
collapsible = $el.addClass( "ui-collapsible" ),
collapsibleHeading = $el.children( o.heading ).first(),
collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).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" ) ) {
Expand Down Expand Up @@ -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
Expand Down

2 comments on commit 94389bd

@johnbender
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Wilto @gseguin

I could be wrong here but I think this commit covers more than a variable rename. This appears to be the cause of #3529. Can you guys sort out what should and shouldn't be there and add some tests to prevent this regression in the future? Happy presidents day!

@gseguin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnbender

I remember now! This code was moved to jquery.mobile.collapsibleSet.js. Though you're right, the comment is very misleading.

Please sign in to comment.