]> source.dussan.org Git - jquery-ui.git/commitdiff
Revert "Mouse: Changed mouseHandled check to a local var rather than using originalEv...
authorScott González <scott.gonzalez@gmail.com>
Mon, 1 Aug 2011 18:16:16 +0000 (14:16 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 1 Aug 2011 18:16:16 +0000 (14:16 -0400)
This reverts commit 9c50bdfde0260fc8412eec1c5020ed6b61558ebd.

ui/jquery.ui.mouse.js

index 582eaf9c046d6699c84071d72747a1573024776f..054e5dc63ac39fa27f5c9b84e937ea34045caedf 100644 (file)
  */
 (function( $, undefined ) {
 
-var mouseHandled = false;
-$(document).mousedown(function(e) {
-       mouseHandled = false;
-});
-
 $.widget("ui.mouse", {
        version: "@VERSION",
        options: {
@@ -50,7 +45,9 @@ $.widget("ui.mouse", {
 
        _mouseDown: function(event) {
                // don't let more than one widget handle mouseStart
-               if(mouseHandled) {return};
+               // TODO: figure out why we have to use originalEvent
+               event.originalEvent = event.originalEvent || {};
+               if (event.originalEvent.mouseHandled) { return; }
 
                // we may have missed mouseup (out of window)
                (this._mouseStarted && this._mouseUp(event));
@@ -96,8 +93,7 @@ $.widget("ui.mouse", {
                        .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
 
                event.preventDefault();
-               
-               mouseHandled = true;
+               event.originalEvent.mouseHandled = true;
                return true;
        },