Browse files

Fixes 4196 - Collapsibles nested in an accordion set are always trea…

…ted as accordions

How fixed: Checked if the closest parent is a collapsible-set before
triggering the collapse event.

How tested: http://jsbin.com/omacox/100 and Docs
  • Loading branch information...
1 parent d3559ab commit 36564b87fc5ea95ecb76cb09ed186f13df736e3d Jason Scott committed May 4, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 js/jquery.mobile.collapsibleSet.js
View
11 js/jquery.mobile.collapsibleSet.js
@@ -47,10 +47,13 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
}
})
.bind( "expand", function( event ) {
- $( event.target )
- .closest( ".ui-collapsible" )
- .siblings( ".ui-collapsible" )
- .trigger( "collapse" );
+ var closestCollapsible = $( event.target )
+ .closest( ".ui-collapsible" );
+ if( closestCollapsible.parent().is( ":jqmData(role='collapsible-set')" ) ) {
+ closestCollapsible
+ .siblings( ".ui-collapsible" )
+ .trigger( "collapse" );
+ }
});
}
},

0 comments on commit 36564b8

Please sign in to comment.