jellyfish-web/dashboard-ui/bower_components/jquery/src/css/hiddenVisibleSelectors.js

19 lines
526 B
JavaScript
Raw Normal View History

2016-01-14 12:04:42 -05:00
define( [
2015-06-26 11:53:49 -04:00
"../core",
"../selector"
], function( jQuery ) {
jQuery.expr.filters.hidden = function( elem ) {
2016-01-14 12:04:42 -05:00
return !jQuery.expr.filters.visible( elem );
2015-06-26 11:53:49 -04:00
};
jQuery.expr.filters.visible = function( elem ) {
2016-01-14 12:04:42 -05:00
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
// Use OR instead of AND as the element is not visible if either is true
// See tickets #10406 and #13132
return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
2015-06-26 11:53:49 -04:00
};
2016-01-14 12:04:42 -05:00
} );