aboutsummaryrefslogtreecommitdiffstats
path: root/ui/safe-active-element.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/safe-active-element.js')
-rw-r--r--ui/safe-active-element.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/ui/safe-active-element.js b/ui/safe-active-element.js
deleted file mode 100644
index 9d6968e08..000000000
--- a/ui/safe-active-element.js
+++ /dev/null
@@ -1,44 +0,0 @@
-( function( factory ) {
- "use strict";
-
- if ( typeof define === "function" && define.amd ) {
-
- // AMD. Register as an anonymous module.
- define( [ "jquery", "./version" ], factory );
- } else {
-
- // Browser globals
- factory( jQuery );
- }
-} )( function( $ ) {
-"use strict";
-
-return $.ui.safeActiveElement = function( document ) {
- var activeElement;
-
- // Support: IE 9 only
- // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
- try {
- activeElement = document.activeElement;
- } catch ( error ) {
- activeElement = document.body;
- }
-
- // Support: IE 9 - 11 only
- // IE may return null instead of an element
- // Interestingly, this only seems to occur when NOT in an iframe
- if ( !activeElement ) {
- activeElement = document.body;
- }
-
- // Support: IE 11 only
- // IE11 returns a seemingly empty object in some cases when accessing
- // document.activeElement from an <iframe>
- if ( !activeElement.nodeName ) {
- activeElement = document.body;
- }
-
- return activeElement;
-};
-
-} );