diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-07-31 16:27:43 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-07-31 16:27:43 -0400 |
commit | e68bee9b84b16ee8a757a7a1f44d93f4ba78c656 (patch) | |
tree | 78f81d54c56ce62cbcb298cd078a9c75339784f2 /ui | |
parent | 7e1cb95d379c95ec412dccf6bc1b4e75dd203951 (diff) | |
download | jquery-ui-e68bee9b84b16ee8a757a7a1f44d93f4ba78c656.tar.gz jquery-ui-e68bee9b84b16ee8a757a7a1f44d93f4ba78c656.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.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.mouse.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 6f95765f2..dc10d9401 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -47,9 +47,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) { |