Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
52 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -24,6 +24,7 @@ | ||
"./data", | ||
"./mouse", | ||
"./plugin", | ||
"./safe-active-element", | ||
"./version", | ||
"./widget" | ||
], factory ); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
( function( factory ) { | ||
if ( typeof define === "function" && define.amd ) { | ||
|
||
// AMD. Register as an anonymous module. | ||
define( [ "jquery", "./version" ], factory ); | ||
} else { | ||
|
||
// Browser globals | ||
factory( jQuery ); | ||
} | ||
} ( function( $ ) { | ||
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; | ||
}; | ||
|
||
} ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -25,6 +25,7 @@ | ||
"./core", | ||
"./escape-selector", | ||
"./keycode", | ||
"./safe-active-element", | ||
"./version", | ||
"./widget" | ||
], factory ); | ||