From c87653bc24f5bc84c299b047d49a06c132a48788 Mon Sep 17 00:00:00 2001 From: Alyosha Pushak Date: Sun, 12 Apr 2015 19:17:16 -0700 Subject: Accordion: Correct height calculated when closed Fixes #11938 Closes gh-1536 Closes gh-1616 --- ui/widgets/accordion.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ui/widgets/accordion.js') diff --git a/ui/widgets/accordion.js b/ui/widgets/accordion.js index 14b3f7303..359b4c46f 100644 --- a/ui/widgets/accordion.js +++ b/ui/widgets/accordion.js @@ -373,7 +373,14 @@ return $.widget( "ui.accordion", { maxHeight = 0; this.headers.next() .each( function() { + var isVisible = $( this ).is( ":visible" ); + if ( !isVisible ) { + $( this ).show(); + } maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); + if ( !isVisible ) { + $( this ).hide(); + } } ) .height( maxHeight ); } -- cgit v1.2.3