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

Commit

Permalink
Collapsible set: Do not rely exclusively on the presence of the data-…
Browse files Browse the repository at this point in the history
…role="collapsibleset" and data-role="collapsible" to identify collapsibles and their parent accordions. Use :mobile-collapsible and :mobile-collapsibleset as well.
  • Loading branch information
Gabriel Schulhof committed Apr 22, 2013
1 parent 62bb9e5 commit 46cd89c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/widgets/collapsibleSet.js
Expand Up @@ -44,7 +44,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, $.extend( {
.bind( "expand", function( event ) {
var closestCollapsible = $( event.target )
.closest( ".ui-collapsible" );
if ( closestCollapsible.parent().is( ":jqmData(role='collapsible-set')" ) ) {
if ( closestCollapsible.parent().is( ":mobile-collapsibleset, :jqmData(role='collapsible-set')" ) ) {
closestCollapsible
.siblings( ".ui-collapsible" )
.trigger( "collapse" );
Expand All @@ -55,7 +55,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, $.extend( {

_init: function() {
var $el = this.element,
collapsiblesInSet = $el.children( ":jqmData(role='collapsible')" ),
collapsiblesInSet = $el.children( ":mobile-collapsible, :jqmData(role='collapsible')" ),
expanded = collapsiblesInSet.filter( ":jqmData(collapsed='false')" );
this._refresh( "true" );

Expand All @@ -65,7 +65,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, $.extend( {
},

_refresh: function( create ) {
var collapsiblesInSet = this.element.children( ":jqmData(role='collapsible')" );
var collapsiblesInSet = this.element.children( ":mobile-collapsible, :jqmData(role='collapsible')" );

$.mobile.collapsible.prototype.enhance( collapsiblesInSet.not( ".ui-collapsible" ) );

Expand Down

0 comments on commit 46cd89c

Please sign in to comment.