Permalink
Browse files

Core: Move safe blur into its own module

Ref #9647
  • Loading branch information...
1 parent 2b84531 commit 26fc3b5587ed117a972224ac661255998e59f9e1 @arschmitz arschmitz committed Jul 16, 2015
Showing with 25 additions and 14 deletions.
  1. +1 −13 ui/core.js
  2. +2 −1 ui/dialog.js
  3. +1 −0 ui/draggable.js
  4. +21 −0 ui/safe-blur.js
View
@@ -30,6 +30,7 @@
"./jquery-1-7",
"./plugin",
"./safe-active-element",
+ "./safe-blur",
"./version"
], factory );
} else {
@@ -39,19 +40,6 @@
}
}( function( $ ) {
-$.extend( $.ui, {
-
- // Internal use only
- safeBlur: function( element ) {
-
- // Support: IE9 - 10 only
- // If the <body> is blurred, IE will switch windows, see #9420
- if ( element && element.nodeName.toLowerCase() !== "body" ) {
- $( element ).trigger( "blur" );
- }
- }
-} );
-
// plugins
$.fn.extend( {
scrollParent: function( includeHidden ) {
View
@@ -31,7 +31,8 @@
"./mouse",
"./position",
"./resizable",
- "./safe-active-element"
+ "./safe-active-element",
+ "./safe-blur"
], factory );
} else {
View
@@ -25,6 +25,7 @@
"./mouse",
"./plugin",
"./safe-active-element",
+ "./safe-blur",
"./version",
"./widget"
], factory );
View
@@ -0,0 +1,21 @@
+( 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.safeBlur = function( element ) {
+
+ // Support: IE9 - 10 only
+ // If the <body> is blurred, IE will switch windows, see #9420
+ if ( element && element.nodeName.toLowerCase() !== "body" ) {
+ $( element ).trigger( "blur" );
+ }
+};
+
+} ) );

0 comments on commit 26fc3b5

Please sign in to comment.