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

Commit

Permalink
Collapsible sets now respect data-corners attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilto committed Apr 5, 2012
1 parent 9185a50 commit 4826f29
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/jquery.mobile.collapsibleSet.js
Expand Up @@ -25,6 +25,10 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
o.contentTheme = $el.jqmData( "content-theme" );
}

if ( !o.corners ) {
o.corners = $el.jqmData( "corners" ) === undefined ? true : false;
}

// Initialize the collapsible set if it's not already initialized
if ( !$el.jqmData( "collapsiblebound" ) ) {
$el
Expand Down Expand Up @@ -57,6 +61,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {

refresh: function() {
var $el = this.element,
o = this.options,
collapsiblesInSet = $el.children( ":jqmData(role='collapsible')" );

$.mobile.collapsible.prototype.enhance( collapsiblesInSet.not( ".ui-collapsible" ) );
Expand All @@ -72,15 +77,15 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
collapsiblesInSet.first()
.find( "a" )
.first()
.addClass( "ui-corner-top" )
.addClass( o.corners ? "ui-corner-top" : "" )
.find( ".ui-btn-inner" )
.addClass( "ui-corner-top" );

collapsiblesInSet.last()
.jqmData( "collapsible-last", true )
.find( "a" )
.first()
.addClass( "ui-corner-bottom" )
.addClass( o.corners ? "ui-corner-bottom" : "" )
.find( ".ui-btn-inner" )
.addClass( "ui-corner-bottom" );
}
Expand Down

0 comments on commit 4826f29

Please sign in to comment.