]> source.dussan.org Git - jquery.git/commitdiff
Moves isHidden to src/css.js and re-introduces its use. No ticket. Closes gh-876
authorOleg <markelog@gmail.com>
Wed, 25 Jul 2012 23:24:10 +0000 (16:24 -0700)
committerRick Waldron <waldron.rick@gmail.com>
Wed, 25 Jul 2012 23:24:10 +0000 (16:24 -0700)
src/css.js
src/effects.js

index d8d5239dd5da46b5337a7eb6a503716fc5a22302..57edd15072a1c5b44c1323ece41406d7346a0455 100644 (file)
@@ -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 {
index dbca88650587d360cb86c34b912a30580cacf537..3405cfdc2f78683c8232644bc900114af1003aa1 100644 (file)
@@ -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 ) {