return h;
}
- if ( isCollapse ) {
+ if ( isCollapse ) { // collapse!
+ // remember current height
$( c ).data( 'max-height', _getHeight( self ) );
- } else {
- if ( ! $( c ).data( 'max-height' ) ) {
- $( c ).data( 'max-height', document.body.clientHeight );
+ $( self ).parentsUntil( '.ui-page', '.ui-collapsible' ).each( function( idx, el ) {
+ var content = $( el ).children('.ui-collapsible-content')[0];
+ $( content ).data( 'max-height', _getHeight( el ) );
+ } );
+
+ } else { // expand!
+ h = $( c ).data( 'max-height' );
+ if ( !h ) {
+ h = document.body.clientHeight;
+ $( c ).data( 'max-height', h );
}
- $( c ).css( 'max-height', $( c ).data( 'max-height' ) );
+ $( c ).css( 'max-height', h );
+ $( self ).parentsUntil( '.ui-page', '.ui-collapsible' ).each( function( idx, el ) {
+ var content = $( el ).children('.ui-collapsible-content')[0];
+ $( content ).css( 'max-height', _getHeight( el ) );
+ } );
}
};
} ( $.mobile.collapsible.prototype.options ) );