CSS: isHidden -> isHiddenWithinTree

Fixes gh-2404
Close gh-2855
This commit is contained in:
Timmy Willison
2016-01-20 13:20:58 -05:00
parent 4d3050b3d8
commit a6fc0b1651
4 changed files with 11 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
define( [
"../core",
"../data/var/dataPriv",
"../css/var/isHidden"
], function( jQuery, dataPriv, isHidden ) {
"../css/var/isHiddenWithinTree"
], function( jQuery, dataPriv, isHiddenWithinTree ) {
var defaultDisplayMap = {};
@@ -95,7 +95,7 @@ jQuery.fn.extend( {
}
return this.each( function() {
if ( isHidden( this ) ) {
if ( isHiddenWithinTree( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();

View File

@@ -5,9 +5,11 @@ define( [
// css is assumed
], function( jQuery ) {
// This function differs from the :hidden selector
// in that it intentionally ignores hidden ancestors (gh-2404)
return function( elem, el ) {
// isHidden might be called from jQuery#filter function;
// isHiddenWithinTree might be called from jQuery#filter function;
// in that case, element will be second argument
elem = el || elem;
return jQuery.css( elem, "display" ) === "none" ||