Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

45 строки
1014 B

  1. ( function( factory ) {
  2. "use strict";
  3. if ( typeof define === "function" && define.amd ) {
  4. // AMD. Register as an anonymous module.
  5. define( [ "jquery", "./version" ], factory );
  6. } else {
  7. // Browser globals
  8. factory( jQuery );
  9. }
  10. } )( function( $ ) {
  11. "use strict";
  12. return $.ui.safeActiveElement = function( document ) {
  13. var activeElement;
  14. // Support: IE 9 only
  15. // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
  16. try {
  17. activeElement = document.activeElement;
  18. } catch ( error ) {
  19. activeElement = document.body;
  20. }
  21. // Support: IE 9 - 11 only
  22. // IE may return null instead of an element
  23. // Interestingly, this only seems to occur when NOT in an iframe
  24. if ( !activeElement ) {
  25. activeElement = document.body;
  26. }
  27. // Support: IE 11 only
  28. // IE11 returns a seemingly empty object in some cases when accessing
  29. // document.activeElement from an <iframe>
  30. if ( !activeElement.nodeName ) {
  31. activeElement = document.body;
  32. }
  33. return activeElement;
  34. };
  35. } );