tabbable.js 886 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*!
  2. * jQuery UI Tabbable 1.14.1
  3. * https://jqueryui.com
  4. *
  5. * Copyright OpenJS Foundation and other contributors
  6. * Released under the MIT license.
  7. * https://jquery.org/license
  8. */
  9. //>>label: :tabbable Selector
  10. //>>group: Core
  11. //>>description: Selects elements which can be tabbed to.
  12. //>>docs: https://api.jqueryui.com/tabbable-selector/
  13. ( function( factory ) {
  14. "use strict";
  15. if ( typeof define === "function" && define.amd ) {
  16. // AMD. Register as an anonymous module.
  17. define( [ "jquery", "./version", "./focusable" ], factory );
  18. } else {
  19. // Browser globals
  20. factory( jQuery );
  21. }
  22. } )( function( $ ) {
  23. "use strict";
  24. return $.extend( $.expr.pseudos, {
  25. tabbable: function( element ) {
  26. var tabIndex = $.attr( element, "tabindex" ),
  27. hasTabindex = tabIndex != null;
  28. return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
  29. }
  30. } );
  31. } );