aboutsummaryrefslogtreecommitdiffstats
path: root/ui/widgets/accordion.js
diff options
context:
space:
mode:
authorAlyosha Pushak <alyosha.pushak@gmail.com>2015-04-12 19:17:16 -0700
committerScott González <scott.gonzalez@gmail.com>2016-02-09 14:40:29 -0500
commitc87653bc24f5bc84c299b047d49a06c132a48788 (patch)
treecd19065718aedd23980ef2b5ade800c8a6f81622 /ui/widgets/accordion.js
parent2bc84615ae306b15e4fed50fb9d2c54e05e62870 (diff)
downloadjquery-ui-c87653bc24f5bc84c299b047d49a06c132a48788.tar.gz
jquery-ui-c87653bc24f5bc84c299b047d49a06c132a48788.zip
Accordion: Correct height calculated when closed
Fixes #11938 Closes gh-1536 Closes gh-1616
Diffstat (limited to 'ui/widgets/accordion.js')
-rw-r--r--ui/widgets/accordion.js7
1 files changed, 7 insertions, 0 deletions
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 );
}