From cb7bb7bb42a66c93dd0400139d4a7da1b7b57b42 Mon Sep 17 00:00:00 2001
From: Alyosha Pushak
Date: Sun, 12 Apr 2015 19:17:16 -0700
Subject: [PATCH 1/5] Accordion: correct height calculated when closed
Fixes #11938
---
ui/accordion.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ui/accordion.js b/ui/accordion.js
index 64635271586..e3a0c829361 100644
--- a/ui/accordion.js
+++ b/ui/accordion.js
@@ -361,7 +361,10 @@ return $.widget( "ui.accordion", {
maxHeight = 0;
this.headers.next()
.each( function() {
+ var display = $( this ).css( "display" );
+ $( this ).css( "display", "block" );
maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
+ $( this ).css( "display", display );
} )
.height( maxHeight );
}
From 6a36202cd7ba4abbd549656be69c90cd93a2d484 Mon Sep 17 00:00:00 2001
From: Alyosha Pushak
Date: Mon, 20 Apr 2015 21:14:21 -0700
Subject: [PATCH 2/5] Accordion: correct height calculated when closed
Fixes #11938
---
ui/accordion.js | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ui/accordion.js b/ui/accordion.js
index e3a0c829361..c3f32336bf2 100644
--- a/ui/accordion.js
+++ b/ui/accordion.js
@@ -361,10 +361,14 @@ return $.widget( "ui.accordion", {
maxHeight = 0;
this.headers.next()
.each( function() {
- var display = $( this ).css( "display" );
- $( this ).css( "display", "block" );
+ var isVisible = $( this ).is ( ":visible" );
+ if ( !isVisible ) {
+ $( this ).show();
+ }
maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
- $( this ).css( "display", display );
+ if ( !isVisible ) {
+ $( this ).hide();
+ }
} )
.height( maxHeight );
}
From 693c9a5d07b1e12b4ae67be366c3e95c473e8400 Mon Sep 17 00:00:00 2001
From: Alyosha Pushak
Date: Tue, 21 Apr 2015 22:14:56 -0700
Subject: [PATCH 3/5] Accordian: correct height calculated when closed
white space correction
---
ui/accordion.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/accordion.js b/ui/accordion.js
index c3f32336bf2..00af1d62145 100644
--- a/ui/accordion.js
+++ b/ui/accordion.js
@@ -361,7 +361,7 @@ return $.widget( "ui.accordion", {
maxHeight = 0;
this.headers.next()
.each( function() {
- var isVisible = $( this ).is ( ":visible" );
+ var isVisible = $( this ).is( ":visible" );
if ( !isVisible ) {
$( this ).show();
}
From 9b720f8c5a36fb7e258f5ae024443e07f848ea3c Mon Sep 17 00:00:00 2001
From: Alyosha Pushak
Date: Wed, 22 Apr 2015 22:04:12 -0700
Subject: [PATCH 4/5] Accordion: unit test for collapsed height
---
tests/unit/accordion/accordion.html | 19 ++++++++++++++++++-
tests/unit/accordion/methods.js | 12 ++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html
index 683b87456cb..ce58567552b 100644
--- a/tests/unit/accordion/accordion.html
+++ b/tests/unit/accordion/accordion.html
@@ -8,12 +8,16 @@
@@ -109,6 +113,19 @@
+
+
+
Header
+
+
+ The calculated height of this accordion should be the same
+ regardless of whether the accordion was collapsed or not
+ when the height was calculated.
+
+
+
+
+