Permalink
Browse files

Core: Move tabbable into its own module

Ref #9647
  • Loading branch information...
arschmitz committed Jul 16, 2015
1 parent 26fc3b5 commit 6064a5e0487428d53bd694dcebce952730992c46
Showing with 41 additions and 11 deletions.
  1. +3 −2 tests/unit/core/selector.js
  2. +1 −8 ui/core.js
  3. +2 −1 ui/dialog.js
  4. +35 −0 ui/tabbable.js
@@ -1,8 +1,9 @@
define( [
"jquery",
"ui/core",
"ui/data",
"ui/focusable"
"ui/escape-selector",
"ui/focusable",
"ui/tabbable"
], function( $ ) {
module( "core - selectors" );
View
@@ -31,6 +31,7 @@
"./plugin",
"./safe-active-element",
"./safe-blur",
"./tabbable",
"./version"
], factory );
} else {
@@ -78,12 +79,4 @@ $.fn.extend( {
}
} );
$.extend( $.expr[ ":" ], {
tabbable: function( element ) {
var tabIndex = $.attr( element, "tabindex" ),
hasTabindex = tabIndex != null;
return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
}
} );
} ) );
View
@@ -32,7 +32,8 @@
"./position",
"./resizable",
"./safe-active-element",
"./safe-blur"
"./safe-blur",
"./tabbable"
], factory );
} else {
View
@@ -0,0 +1,35 @@
/*!
* jQuery UI Tabbable @VERSION
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
//>>label: focusable
//>>group: Core
//>>description: Selects elements which can be tabbed to.
//>>docs: http://api.jqueryui.com/tabbable-selector/
( function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define( [ "jquery", "./version", "./focusable" ], factory );
} else {
// Browser globals
factory( jQuery );
}
} ( function( $ ) {
return $.extend( $.expr[ ":" ], {
tabbable: function( element ) {
var tabIndex = $.attr( element, "tabindex" ),
hasTabindex = tabIndex != null;
return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
}
} );
} ) );

0 comments on commit 6064a5e

Please sign in to comment.