From 686f10bb227d6396481f28c3d935aefd2fe43598 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Wed, 16 Jul 2014 15:34:47 -0400 Subject: [PATCH] Make display:auto respect cascading styles --- jquery.velocity.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/jquery.velocity.js b/jquery.velocity.js index 37adf67c..907a9c9f 100644 --- a/jquery.velocity.js +++ b/jquery.velocity.js @@ -1917,11 +1917,6 @@ Velocity's structure: /* Refer to Velocity's documentation (VelocityJS.org/#displayAndVisibility) for a description of the display and visibility options' behavior. */ if (opts.display) { opts.display = opts.display.toString().toLowerCase(); - - /* Users can pass in a special "auto" value to instruct Velocity to set the element to its default display value. */ - if (opts.display === "auto") { - opts.display = Velocity.CSS.Values.getDisplayType(element); - } } if (opts.visibility) { @@ -2870,7 +2865,7 @@ Velocity's structure: /* If the display option is set to non-"none", set it upfront so that the element can become visible before tweening begins. (Otherwise, display's "none" value is set in completeCall() once the animation has completed.) */ if (opts.display && opts.display !== "none") { - CSS.setPropertyValue(element, "display", opts.display); + CSS.setPropertyValue(element, "display", opts.display === "auto" ? null : opts.display); } /* Same goes with the visibility option, but its "none" equivalent is "hidden". */