Merge "Added result properties to action=paraminfo"
[lhc/web/wiklou.git] / resources / jquery.ui / jquery.ui.mouse.js
index b8db85c..a4392de 100644 (file)
@@ -1,7 +1,7 @@
 /*!
- * jQuery UI Mouse 1.8.11
+ * jQuery UI Mouse 1.8.21
  *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
  * Dual licensed under the MIT or GPL Version 2 licenses.
  * http://jquery.org/license
  *
  */
 (function( $, undefined ) {
 
+var mouseHandled = false;
+$( document ).mouseup( function( e ) {
+       mouseHandled = false;
+});
+
 $.widget("ui.mouse", {
        options: {
                cancel: ':input,option',
@@ -40,13 +45,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
-               // TODO: figure out why we have to use originalEvent
-               event.originalEvent = event.originalEvent || {};
-               if (event.originalEvent.mouseHandled) { return; }
+               if( mouseHandled ) { return };
 
                // we may have missed mouseup (out of window)
                (this._mouseStarted && this._mouseUp(event));
@@ -55,7 +61,9 @@ $.widget("ui.mouse", {
 
                var self = this,
                        btnIsLeft = (event.which == 1),
-                       elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
+                       // 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);
                if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
                        return true;
                }
@@ -92,7 +100,8 @@ $.widget("ui.mouse", {
                        .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
 
                event.preventDefault();
-               event.originalEvent.mouseHandled = true;
+               
+               mouseHandled = true;
                return true;
        },