aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-07-31 16:27:43 -0400
committerScott González <scott.gonzalez@gmail.com>2012-07-31 16:28:12 -0400
commit25f20b18bd43dd4259b64e016d397ba45f5c6934 (patch)
treeeddeabe78ffec068a589e4386d96bcecd7863a3f /ui
parent7d8c99de53273b7b7fb13b839c4ab296a2059277 (diff)
downloadjquery-ui-25f20b18bd43dd4259b64e016d397ba45f5c6934.tar.gz
jquery-ui-25f20b18bd43dd4259b64e016d397ba45f5c6934.zip
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 e68bee9b84b16ee8a757a7a1f44d93f4ba78c656)
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.mouse.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js
index 1767de8fb..de76ad439 100644
--- a/ui/jquery.ui.mouse.js
+++ b/ui/jquery.ui.mouse.js
@@ -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) {