Skip to content
Permalink
Browse files

Core: Added :tabbable selector to find elements that participate in t…

…he tabbing order.
  • Loading branch information
scottgonzalez committed Sep 5, 2008
1 parent d5bea56 commit 54eccb6b04303cfaa27fbe3a3ddd1147e5220359
Showing with 23 additions and 4 deletions.
  1. +23 −4 ui/ui.core.js
@@ -17,10 +17,29 @@ $.fn.remove = function() {
return _remove.apply(this, arguments );
};

// This adds a selector to check if data exists.
$.expr[':'].data = function(a, i, m) {
return $.data(a, m[3]);
};
$.extend($.expr[':'], {
data: function(a, i, m) {
return $.data(a, m[3]);
},

// TODO: add support for object, area
tabbable: function(a, i, m) {
var nodeName = a.nodeName.toLowerCase();

return (
// in tab order
a.tabIndex != -1 &&

( // node type participates in tab order
// anchor tag
('a' == nodeName) ||

// enabled form element
(/input|select|textarea|button/.test(nodeName) && !a.disabled)
)
);
}
});

$.keyCode = {
BACKSPACE: 8,

0 comments on commit 54eccb6

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