diff options
Diffstat (limited to 'ui/jquery.ui.mouse.js')
-rw-r--r-- | ui/jquery.ui.mouse.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 64a081961..eaa953ad0 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -46,11 +46,14 @@ $.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); }, _mouseDown: function(event) { // don't let more than one widget handle mouseStart - if( mouseHandled ) { return }; + if( mouseHandled ) { return; } // we may have missed mouseup (out of window) (this._mouseStarted && this._mouseUp(event)); @@ -58,10 +61,10 @@ $.widget("ui.mouse", { this._mouseDownEvent = event; var that = this, - btnIsLeft = (event.which == 1), + btnIsLeft = (event.which === 1), // event.target.nodeName works around a bug in IE 8 with // disabled inputs (#7620) - elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { return true; } @@ -131,7 +134,7 @@ $.widget("ui.mouse", { if (this._mouseStarted) { this._mouseStarted = false; - if (event.target == this._mouseDownEvent.target) { + if (event.target === this._mouseDownEvent.target) { $.data(event.target, this.widgetName + '.preventClickEvent', true); } |