aboutsummaryrefslogtreecommitdiffstats
path: root/src/css.js
diff options
context:
space:
mode:
authorOleg <markelog@gmail.com>2012-07-25 16:24:10 -0700
committerRick Waldron <waldron.rick@gmail.com>2012-07-25 16:24:10 -0700
commit5119b252ac2f3391e9f23efef4852095e0d7e6b3 (patch)
tree668668434af1393bab4cb7d950366cc7a9660061 /src/css.js
parentd00048eabec29c783ca76560340692cda4c677ff (diff)
downloadjquery-5119b252ac2f3391e9f23efef4852095e0d7e6b3.tar.gz
jquery-5119b252ac2f3391e9f23efef4852095e0d7e6b3.zip
Moves isHidden to src/css.js and re-introduces its use. No ticket. Closes gh-876
Diffstat (limited to 'src/css.js')
-rw-r--r--src/css.js8
1 files changed, 6 insertions, 2 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 {