Accordion: Handle box-sizing: border-box in animations

Fixes #9264
Closes gh-1287
Closes gh-1459
This commit is contained in:
Scott González 2015-03-02 18:43:07 -05:00
parent c077e0a347
commit 4b017b414f

View File

@ -524,6 +524,7 @@ return $.widget( "ui.accordion", {
var total, easing, duration, var total, easing, duration,
that = this, that = this,
adjust = 0, adjust = 0,
boxSizing = toShow.css( "box-sizing" ),
down = toShow.length && down = toShow.length &&
( !toHide.length || ( toShow.index() < toHide.index() ) ), ( !toHide.length || ( toShow.index() < toHide.index() ) ),
animate = this.options.animate || {}, animate = this.options.animate || {},
@ -566,7 +567,9 @@ return $.widget( "ui.accordion", {
step: function( now, fx ) { step: function( now, fx ) {
fx.now = Math.round( now ); fx.now = Math.round( now );
if ( fx.prop !== "height" ) { if ( fx.prop !== "height" ) {
adjust += fx.now; if ( boxSizing === "content-box" ) {
adjust += fx.now;
}
} else if ( that.options.heightStyle !== "content" ) { } else if ( that.options.heightStyle !== "content" ) {
fx.now = Math.round( total - toHide.outerHeight() - adjust ); fx.now = Math.round( total - toHide.outerHeight() - adjust );
adjust = 0; adjust = 0;