collapsible: Fix collapsible list animation bug
authorYoumin Ha <youmin.ha@samsung.com>
Thu, 11 Apr 2013 10:38:57 +0000 (19:38 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Tue, 16 Apr 2013 04:34:17 +0000 (13:34 +0900)
This patch recalculates parent collapsible content's max-height when
inner commapsible is expanded.
Fixes N_SE-33118.

Change-Id: I510168cb57c25598ec6b649394c57f2f1fc127ac

src/themes/tizen/tizen-white/theme.js

index 1a40465..394ebc0 100644 (file)
@@ -45,13 +45,25 @@ $( function ( o ) {
                        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 ) );