Skip to content

Commit

Permalink
CSS: isHidden -> isHiddenWithinTree
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Jan 21, 2016
1 parent 4d3050b commit a6fc0b1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ define( [
"./var/rcssNum",
"./css/var/rnumnonpx",
"./css/var/cssExpand",
"./css/var/isHidden",
"./css/var/getStyles",
"./css/var/swap",
"./css/curCSS",
Expand All @@ -19,7 +18,7 @@ define( [
"./core/ready",
"./selector" // contains
], function( jQuery, pnum, access, rmargin, document, rcssNum, rnumnonpx, cssExpand,
isHidden, getStyles, swap, curCSS, adjustCSS, addGetHookIf, support ) {
getStyles, swap, curCSS, adjustCSS, addGetHookIf, support ) {

var

Expand Down
6 changes: 3 additions & 3 deletions src/css/showHide.js
Original file line number Diff line number Diff line change
@@ -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 = {};

Expand Down Expand Up @@ -95,7 +95,7 @@ jQuery.fn.extend( {
}

return this.each( function() {
if ( isHidden( this ) ) {
if ( isHiddenWithinTree( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" ||
Expand Down
8 changes: 4 additions & 4 deletions src/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define( [
"./var/rcssNum",
"./var/rnotwhite",
"./css/var/cssExpand",
"./css/var/isHidden",
"./css/var/isHiddenWithinTree",
"./css/var/swap",
"./css/adjustCSS",
"./data/var/dataPriv",
Expand All @@ -17,7 +17,7 @@ define( [
"./manipulation",
"./css",
"./effects/Tween"
], function( jQuery, document, rcssNum, rnotwhite, cssExpand, isHidden, swap,
], function( jQuery, document, rcssNum, rnotwhite, cssExpand, isHiddenWithinTree, swap,
adjustCSS, dataPriv, showHide ) {

var
Expand Down Expand Up @@ -82,7 +82,7 @@ function defaultPrefilter( elem, props, opts ) {
anim = this,
orig = {},
style = elem.style,
hidden = elem.nodeType && isHidden( elem ),
hidden = elem.nodeType && isHiddenWithinTree( elem ),
dataShow = dataPriv.get( elem, "fxshow" );

// Queue-skipping animations hijack the fx hooks
Expand Down Expand Up @@ -479,7 +479,7 @@ jQuery.fn.extend( {
fadeTo: function( speed, to, easing, callback ) {

// Show any hidden elements after setting opacity to 0
return this.filter( isHidden ).css( "opacity", 0 ).show()
return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()

// Animate to the value specified
.end().animate( { opacity: to }, speed, easing, callback );
Expand Down

0 comments on commit a6fc0b1

Please sign in to comment.