Skip to content

Commit

Permalink
Accordion: Handle box-sizing: border-box in animations
Browse files Browse the repository at this point in the history
Fixes #9264
Closes gh-1287
Closes gh-1459
  • Loading branch information
scottgonzalez committed Mar 3, 2015
1 parent c077e0a commit 4b017b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ return $.widget( "ui.accordion", {
var total, easing, duration,
that = this,
adjust = 0,
boxSizing = toShow.css( "box-sizing" ),
down = toShow.length &&
( !toHide.length || ( toShow.index() < toHide.index() ) ),
animate = this.options.animate || {},
Expand Down Expand Up @@ -566,7 +567,9 @@ return $.widget( "ui.accordion", {
step: function( now, fx ) {
fx.now = Math.round( now );
if ( fx.prop !== "height" ) {
adjust += fx.now;
if ( boxSizing === "content-box" ) {
adjust += fx.now;
}
} else if ( that.options.heightStyle !== "content" ) {
fx.now = Math.round( total - toHide.outerHeight() - adjust );
adjust = 0;
Expand Down

0 comments on commit 4b017b4

Please sign in to comment.