From 0eb843fd65abc6c951171b8aba3c61dfcd2a7570 Mon Sep 17 00:00:00 2001 From: Youmin Ha Date: Thu, 11 Apr 2013 19:38:57 +0900 Subject: [PATCH] collapsible: Fix collapsible list animation bug 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 | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/themes/tizen/tizen-white/theme.js b/src/themes/tizen/tizen-white/theme.js index 1a40465..394ebc0 100644 --- a/src/themes/tizen/tizen-white/theme.js +++ b/src/themes/tizen/tizen-white/theme.js @@ -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 ) ); -- 2.7.4