mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Core: Added :tabbable selector to find elements that participate in the tabbing order.
This commit is contained in:
parent
d5bea560de
commit
54eccb6b04
@ -17,10 +17,29 @@ $.fn.remove = function() {
|
|||||||
return _remove.apply(this, arguments );
|
return _remove.apply(this, arguments );
|
||||||
};
|
};
|
||||||
|
|
||||||
// This adds a selector to check if data exists.
|
$.extend($.expr[':'], {
|
||||||
$.expr[':'].data = function(a, i, m) {
|
data: function(a, i, m) {
|
||||||
return $.data(a, m[3]);
|
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 = {
|
$.keyCode = {
|
||||||
BACKSPACE: 8,
|
BACKSPACE: 8,
|
||||||
|
Loading…
Reference in New Issue
Block a user