]> source.dussan.org Git - jquery-ui.git/commitdiff
Mouse: Changed mouseHandled check to a local var rather than using originalEvent... 235/head
authorkborchers <k_borchers@yahoo.com>
Mon, 9 May 2011 16:43:45 +0000 (11:43 -0500)
committerkborchers <k_borchers@yahoo.com>
Mon, 9 May 2011 16:43:45 +0000 (11:43 -0500)
ui/jquery.ui.mouse.js

index bfe4a757825f7245ebd6b72c29721e24a7f02eb0..0bd38db8530bf32dec3b44e0081c6f0377b17bfb 100644 (file)
  */
 (function( $, undefined ) {
 
+var mouseHandled = false;
+$(document).mousedown(function(e) {
+       mouseHandled = false;
+});
+
 $.widget("ui.mouse", {
        options: {
                cancel: ':input,option',
@@ -44,9 +49,7 @@ $.widget("ui.mouse", {
 
        _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));
@@ -92,7 +95,8 @@ $.widget("ui.mouse", {
                        .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
 
                event.preventDefault();
-               event.originalEvent.mouseHandled = true;
+               
+               mouseHandled = true;
                return true;
        },