diff options
author | Scott González <scott.gonzalez@gmail.com> | 2008-11-07 13:40:01 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2008-11-07 13:40:01 +0000 |
commit | 8dc3f8d64394992f312a3ec41675ae1d0f92b465 (patch) | |
tree | 1cc93e639683dc171d959fb3caa93aeed97af4af | |
parent | 8becd36f2d93ad8b9c745c07f13d9a44bf7bb1bb (diff) | |
download | jquery-ui-8dc3f8d64394992f312a3ec41675ae1d0f92b465.tar.gz jquery-ui-8dc3f8d64394992f312a3ec41675ae1d0f92b465.zip |
Core: Rewrote isVisible(). New implementation inspired by Remy's :reallyvisible selector.
-rw-r--r-- | ui/ui.core.js | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js index 904469350..cae5af7e2 100644 --- a/ui/ui.core.js +++ b/ui/ui.core.js @@ -168,21 +168,10 @@ $.extend($.expr[':'], { // TODO: add support for object, area tabbable: function(a, i, m) { - + var nodeName = a.nodeName.toLowerCase(); function isVisible(element) { - function checkStyles(element) { - var style = element.style; - return (style.display != 'none' && style.visibility != 'hidden'); - } - - var visible = checkStyles(element); - - (visible && $.each($.dir(element, 'parentNode'), function() { - return (visible = checkStyles(this)); - })); - - return visible; + return !$(element).parents().andSelf().filter(':hidden').length; } return ( |