Commit 5119b252 authored by Oleg's avatar Oleg Committed by Rick Waldron

Moves isHidden to src/css.js and re-introduces its use. No ticket. Closes gh-876

parent d00048ea
...@@ -43,6 +43,11 @@ function vendorPropName( style, name ) { ...@@ -43,6 +43,11 @@ function vendorPropName( style, name ) {
return origName; 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 ) { function showHide( elements, show ) {
var elem, display, var elem, display,
values = [], values = [],
...@@ -65,8 +70,7 @@ function showHide( elements, show ) { ...@@ -65,8 +70,7 @@ function showHide( elements, show ) {
// Set elements which have been overridden with display: none // Set elements which have been overridden with display: none
// in a stylesheet to whatever the default browser style is // in a stylesheet to whatever the default browser style is
// for such an element // for such an element
if ( (elem.style.display === "" && curCSS( elem, "display" ) === "none") || if ( elem.style.display === "" && isHidden( elem ) ) {
!jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
} }
} else { } else {
......
...@@ -437,11 +437,6 @@ Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { ...@@ -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 ) { jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
var cssFn = jQuery.fn[ name ]; var cssFn = jQuery.fn[ name ];
jQuery.fn[ name ] = function( speed, easing, callback ) { jQuery.fn[ name ] = function( speed, easing, callback ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment