From 5119b252ac2f3391e9f23efef4852095e0d7e6b3 Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 25 Jul 2012 16:24:10 -0700 Subject: [PATCH] Moves isHidden to src/css.js and re-introduces its use. No ticket. Closes gh-876 --- src/css.js | 8 ++++++-- src/effects.js | 5 ----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/css.js b/src/css.js index d8d5239dd..57edd1507 100644 --- a/src/css.js +++ b/src/css.js @@ -43,6 +43,11 @@ function vendorPropName( style, name ) { return origName; } +function isHidden( elem, el ) { + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument.documentElement, elem ); +} + function showHide( elements, show ) { var elem, display, values = [], @@ -65,8 +70,7 @@ function showHide( elements, show ) { // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element - if ( (elem.style.display === "" && curCSS( elem, "display" ) === "none") || - !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { + if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { diff --git a/src/effects.js b/src/effects.js index dbca88650..3405cfdc2 100644 --- a/src/effects.js +++ b/src/effects.js @@ -437,11 +437,6 @@ Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { } }; -function isHidden( elem, el ) { - elem = el || elem; - return curCSS( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument.documentElement, elem ); -} - jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { -- 2.39.5