aboutsummaryrefslogtreecommitdiffstats
path: root/src/effects.js
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2016-01-11 02:26:55 -0500
committerTimmy Willison <timmywillisn@gmail.com>2016-01-13 16:05:09 -0500
commitdba93f79c405373ec3a492fd0a4bf89b3136a6e6 (patch)
tree49aca78a21bb34ebb7d834a270c090b9de91522a /src/effects.js
parenta268f5225cad9ab380494e61a10105cc9eb107e7 (diff)
downloadjquery-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.js13
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