Mouse: Don't try to unbind delegated event handlers if they don't exist. Fixes #8416 - Draggable breaks during drag if any other draggable is removed or destroyed.

(cherry picked from commit e68bee9b84)
This commit is contained in:
Scott González 2012-07-31 16:27:43 -04:00
parent 7d8c99de53
commit 25f20b18bd

View File

@ -45,9 +45,11 @@ $.widget("ui.mouse", {
// other instances of mouse
_mouseDestroy: function() {
this.element.unbind('.'+this.widgetName);
$(document)
.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
if ( this._mouseMoveDelegate ) {
$(document)
.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
}
},
_mouseDown: function(event) {