File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 define ( [
2424 "jquery" ,
2525 "./core" ,
26+ "./version" ,
2627 "./keycode" ,
2728 "./widget" ,
2829 "./position" ,
29- "./version " ,
30- "./menu "
30+ "./menu " ,
31+ "./safe-active-element "
3132 ] , factory ) ;
3233 } else {
3334
Original file line number Diff line number Diff line change 2929 "./labels" ,
3030 "./jquery-1-7" ,
3131 "./plugin" ,
32+ "./safe-active-element" ,
3233 "./version"
3334 ] , factory ) ;
3435 } else {
4041
4142$ . extend ( $ . ui , {
4243
43- // Internal use only
44- safeActiveElement : function ( document ) {
45- var activeElement ;
46-
47- // Support: IE 9 only
48- // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
49- try {
50- activeElement = document . activeElement ;
51- } catch ( error ) {
52- activeElement = document . body ;
53- }
54-
55- // Support: IE 9 - 11 only
56- // IE may return null instead of an element
57- // Interestingly, this only seems to occur when NOT in an iframe
58- if ( ! activeElement ) {
59- activeElement = document . body ;
60- }
61-
62- // Support: IE 11 only
63- // IE11 returns a seemingly empty object in some cases when accessing
64- // document.activeElement from an <iframe>
65- if ( ! activeElement . nodeName ) {
66- activeElement = document . body ;
67- }
68-
69- return activeElement ;
70- } ,
71-
7244 // Internal use only
7345 safeBlur : function ( element ) {
7446
Original file line number Diff line number Diff line change 2222 // AMD. Register as an anonymous module.
2323 define ( [
2424 "jquery" ,
25- "./core " ,
25+ "./version " ,
2626 "./keycode" ,
2727 "./widget" ,
2828 "./button" ,
3131 "./mouse" ,
3232 "./position" ,
3333 "./resizable" ,
34- "./version "
34+ "./safe-active-element "
3535 ] , factory ) ;
3636 } else {
3737
Original file line number Diff line number Diff line change 2424 "./data" ,
2525 "./mouse" ,
2626 "./plugin" ,
27+ "./safe-active-element" ,
2728 "./version" ,
2829 "./widget"
2930 ] , factory ) ;
Original file line number Diff line number Diff line change 2525 "./core" ,
2626 "./version" ,
2727 "./keycode" ,
28- "./widget" ,
29- "./position"
28+ "./position" ,
29+ "./safe-active-element" ,
30+ "./widget"
3031 ] , factory ) ;
3132 } else {
3233
Original file line number Diff line number Diff line change 1+ ( function ( factory ) {
2+ if ( typeof define === "function" && define . amd ) {
3+
4+ // AMD. Register as an anonymous module.
5+ define ( [ "jquery" , "./version" ] , factory ) ;
6+ } else {
7+
8+ // Browser globals
9+ factory ( jQuery ) ;
10+ }
11+ } ( function ( $ ) {
12+ return $ . ui . safeActiveElement = function ( document ) {
13+ var activeElement ;
14+
15+ // Support: IE 9 only
16+ // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
17+ try {
18+ activeElement = document . activeElement ;
19+ } catch ( error ) {
20+ activeElement = document . body ;
21+ }
22+
23+ // Support: IE 9 - 11 only
24+ // IE may return null instead of an element
25+ // Interestingly, this only seems to occur when NOT in an iframe
26+ if ( ! activeElement ) {
27+ activeElement = document . body ;
28+ }
29+
30+ // Support: IE 11 only
31+ // IE11 returns a seemingly empty object in some cases when accessing
32+ // document.activeElement from an <iframe>
33+ if ( ! activeElement . nodeName ) {
34+ activeElement = document . body ;
35+ }
36+
37+ return activeElement ;
38+ } ;
39+
40+ } ) ) ;
Original file line number Diff line number Diff line change 2222 // AMD. Register as an anonymous module.
2323 define ( [
2424 "jquery" ,
25- "./core" ,
2625 "./version" ,
2726 "./keycode" ,
27+ "./safe-active-element" ,
2828 "./widget" ,
2929 "./button"
3030 ] , factory ) ;
Original file line number Diff line number Diff line change 2525 "./core" ,
2626 "./escape-selector" ,
2727 "./keycode" ,
28+ "./safe-active-element" ,
2829 "./version" ,
2930 "./widget"
3031 ] , factory ) ;
You can’t perform that action at this time.
0 commit comments