diff options
author | Brian Grinstead <briangrinstead@gmail.com> | 2010-06-14 08:20:03 -0700 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2013-05-20 22:10:04 -0400 |
commit | 24756a978a977d7abbef5e5bce403837a01d964f (patch) | |
tree | 59b473b02fc600d054a3b47ade5b0819f701bd76 /ui/jquery.ui.mouse.js | |
parent | 433ef9d433e9baa464cd0b313b82efa6f1d65556 (diff) | |
download | jquery-ui-24756a978a977d7abbef5e5bce403837a01d964f.tar.gz jquery-ui-24756a978a977d7abbef5e5bce403837a01d964f.zip |
Draggable: enabled draggable from within iframe. Fixed #5727 - draggable: cannot drag element inside iframe
Diffstat (limited to 'ui/jquery.ui.mouse.js')
-rw-r--r-- | ui/jquery.ui.mouse.js | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index df887d334..ca774e3da 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -48,7 +48,7 @@ $.widget("ui.mouse", { _mouseDestroy: function() { this.element.unbind("."+this.widgetName); if ( this._mouseMoveDelegate ) { - $(document) + this.document .unbind("mousemove."+this.widgetName, this._mouseMoveDelegate) .unbind("mouseup."+this.widgetName, this._mouseUpDelegate); } @@ -99,9 +99,10 @@ $.widget("ui.mouse", { this._mouseUpDelegate = function(event) { return that._mouseUp(event); }; - $(document) - .bind("mousemove."+this.widgetName, this._mouseMoveDelegate) - .bind("mouseup."+this.widgetName, this._mouseUpDelegate); + + this.document + .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) + .bind( "mouseup." + this.widgetName, this._mouseUpDelegate ); event.preventDefault(); @@ -114,6 +115,10 @@ $.widget("ui.mouse", { if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) { return this._mouseUp(event); } + // Iframe mouseup check - mouseup occurred in another document + else if ( !event.which ) { + return this._mouseUp( event ); + } if (this._mouseStarted) { this._mouseDrag(event); @@ -130,9 +135,9 @@ $.widget("ui.mouse", { }, _mouseUp: function(event) { - $(document) - .unbind("mousemove."+this.widgetName, this._mouseMoveDelegate) - .unbind("mouseup."+this.widgetName, this._mouseUpDelegate); + this.document + .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) + .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate ); if (this._mouseStarted) { this._mouseStarted = false; @@ -144,6 +149,7 @@ $.widget("ui.mouse", { this._mouseStop(event); } + mouseHandled = false; return false; }, |