Skip to content
Permalink
Browse files

Minor syntactical changes to :visible and :hidden.

  • Loading branch information
jeresig committed Dec 5, 2009
1 parent b776e2b commit 6071e939c7025ff7096673c93eaa7e2d78afbb6b
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/css.js
@@ -200,18 +200,18 @@ jQuery.extend({
});

if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function(elem){
jQuery.expr.filters.hidden = function( elem ) {
var width = elem.offsetWidth, height = elem.offsetHeight,
force = /^tr$/i.test( elem.nodeName ); // ticket #4512
skip = elem.nodeName.toLowerCase() === "tr";

return width === 0 && height === 0 && !force ?
return width === 0 && height === 0 && !skip ?
true :
width !== 0 && height !== 0 && !force ?
false :
jQuery.curCSS(elem, "display") === "none";
width > 0 && height > 0 && !skip ?
false :
jQuery.curCSS(elem, "display") === "none";
};

jQuery.expr.filters.visible = function(elem){
return !jQuery.expr.filters.hidden(elem);
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}

0 comments on commit 6071e93

Please sign in to comment.
You can’t perform that action at this time.