mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Draggable: Safe activeElement access from iFrames for IE9, prevent window focus changes in IE9+. Fixed #9520 - Draggable: Browser window drops behind other windows in IE9/10
This commit is contained in:
parent
643ef44ee2
commit
eae2c4b358
12
ui/jquery.ui.draggable.js
vendored
12
ui/jquery.ui.draggable.js
vendored
@ -76,9 +76,19 @@ $.widget("ui.draggable", $.ui.mouse, {
|
||||
|
||||
_mouseCapture: function(event) {
|
||||
|
||||
var o = this.options;
|
||||
var document = this.document[ 0 ],
|
||||
o = this.options;
|
||||
|
||||
// support: IE9
|
||||
// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
|
||||
try {
|
||||
// Support: IE9+
|
||||
// If the <body> is blurred, IE will switch windows, see #9520
|
||||
if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
|
||||
// Blur any element that currently has focus, see #4261
|
||||
$( document.activeElement ).blur();
|
||||
}
|
||||
} catch ( error ) {}
|
||||
|
||||
// among others, prevent a drag on a resizable-handle
|
||||
if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user