]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Handle `box-sizing: border-box` in animations
authorScott González <scott.gonzalez@gmail.com>
Mon, 2 Mar 2015 23:43:07 +0000 (18:43 -0500)
committerScott González <scott.gonzalez@gmail.com>
Tue, 3 Mar 2015 13:28:52 +0000 (08:28 -0500)
Fixes #9264
Closes gh-1287
Closes gh-1459

ui/accordion.js

index cf53e9839f70aee82c3c3e6bb62e21dcc4441125..68a4c34ec0f0e2e92c59bd214b7fd1bff38008ff 100644 (file)
@@ -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 || {},
@@ -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;