diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2016-01-11 02:26:55 -0500 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2016-01-13 16:05:09 -0500 |
commit | dba93f79c405373ec3a492fd0a4bf89b3136a6e6 (patch) | |
tree | 49aca78a21bb34ebb7d834a270c090b9de91522a /src/effects.js | |
parent | a268f5225cad9ab380494e61a10105cc9eb107e7 (diff) | |
download | jquery-dba93f79c405373ec3a492fd0a4bf89b3136a6e6.tar.gz jquery-dba93f79c405373ec3a492fd0a4bf89b3136a6e6.zip |
CSS: Restore cascade-override behavior in .show
Fixes gh-2654
Fixes gh-2308
Close gh-2810
Ref 86419b10bfa5e3b71a7d416288ab806d47a31d1f
Diffstat (limited to 'src/effects.js')
-rw-r--r-- | src/effects.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/effects.js b/src/effects.js index 64f9353ef..43162e1fb 100644 --- a/src/effects.js +++ b/src/effects.js @@ -154,9 +154,16 @@ function defaultPrefilter( elem, props, opts ) { } display = jQuery.css( elem, "display" ); if ( display === "none" ) { - display = restoreDisplay || swap( elem, { "display": "" }, function() { - return jQuery.css( elem, "display" ); - } ); + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } } // Animate inline elements as inline-block |