aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.mouse.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/jquery.ui.mouse.js')
-rw-r--r--ui/jquery.ui.mouse.js20
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;
},