Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accordion: fixes #9264 #1287

Closed
wants to merge 22 commits into from
Closed
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
94831fe
Accordion: heightStyle: 'auto' has problems
JacquesPerrault Jul 15, 2014
e4c53e8
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Jul 17, 2014
0780604
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Jul 22, 2014
f443e2a
Accordion: heightStyle: 'auto' has problems
JacquesPerrault Jul 22, 2014
db4889b
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Jul 23, 2014
e0d8dfa
Accordion: heightStyle: 'auto' has problems
JacquesPerrault Jul 23, 2014
157cddd
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Jul 30, 2014
26a7542
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Jul 30, 2014
b904f94
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Aug 5, 2014
ce7522f
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Aug 14, 2014
d2b763b
Accordion: heightStyle: 'auto' has problems
JacquesPerrault Aug 14, 2014
e414a37
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Aug 18, 2014
827234a
Accordion: heightStyle: 'auto' has problems
JacquesPerrault Aug 18, 2014
3dfbcfa
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Aug 20, 2014
d7fedbf
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Aug 25, 2014
a2b75b5
Accordion: heightStyle: 'auto' has problems
JacquesPerrault Aug 25, 2014
0340b91
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Oct 13, 2014
b0ed846
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Nov 6, 2014
b00f70b
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Nov 9, 2014
11f0dd2
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-…
JacquesPerrault Nov 10, 2014
23167de
Accordion: heightStyle: 'auto' has problems
JacquesPerrault Nov 10, 2014
192b7b0
Accordion: heightStyle: 'auto' has problems
JacquesPerrault Nov 13, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions ui/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,13 @@ return $.widget( "ui.accordion", {
} else if ( heightStyle === "auto" ) {
maxHeight = 0;
this.headers.next()
.show()
.each(function() {
maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
})
.height( maxHeight );
.height( maxHeight )
.not( this.active.next() )
.hide();
}
},

Expand Down Expand Up @@ -554,11 +557,19 @@ return $.widget( "ui.accordion", {
complete: complete,
step: function( now, fx ) {
fx.now = Math.round( now );
if ( fx.prop !== "height" ) {
adjust += fx.now;
} else if ( that.options.heightStyle !== "content" ) {
fx.now = Math.round( total - toHide.outerHeight() - adjust );
adjust = 0;
if ( !fx.adjustInit ) {
if ( fx.prop !== "height" ) {
adjust += fx.now;
} else if ( that.options.heightStyle !== "content" &&
( toHide.css( "box-sizing" ) === "border-box" ||
toHide.css( "box-sizing" ) === "padding-box" ) ) {
fx.now = Math.round( total - toHide.outerHeight() );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

border-box and padding-box need different adjustments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I separated padding-box, but only Firefox recognizes it, and it still causes text below the accordion to jump. I know that I need to exclude padding, but I can't seem to get it right.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I might be on board with @mikesherov now; let's just handle border-box and content-box.

adjust = 0;
} else if ( that.options.heightStyle !== "content" ) {
fx.now = Math.round( total - toHide.outerHeight() - adjust);
adjust = 0;
}
fx.adjustInit = true;
}
}
});
Expand Down