Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8e58d6

Browse files
committed
Using latest master
1 parent cfa8e3f commit c8e58d6

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

app/assets/javascripts/jquery.ui.draggable.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,19 @@ $.widget("ui.draggable", $.ui.mouse, {
8080

8181
_mouseCapture: function(event) {
8282

83-
var o = this.options;
84-
85-
// $( document.activeElement ).blur();
83+
var document = this.document[ 0 ],
84+
o = this.options;
85+
86+
// support: IE9
87+
// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
88+
try {
89+
// Support: IE9+
90+
// If the <body> is blurred, IE will switch windows, see #9520
91+
if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
92+
// Blur any element that currently has focus, see #4261
93+
$( document.activeElement ).blur();
94+
}
95+
} catch ( error ) {}
8696

8797
// among others, prevent a drag on a resizable-handle
8898
if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
@@ -985,4 +995,4 @@ $.ui.plugin.add("draggable", "zIndex", {
985995
}
986996
});
987997

988-
})(jQuery);
998+
})(jQuery);

0 commit comments

Comments
 (0)