]> source.dussan.org Git - jquery-ui.git/commitdiff
Mouse: Changed mouseHandled check to a local var rather than using originalEvent...
authorkborchers <k_borchers@yahoo.com>
Tue, 2 Aug 2011 13:36:22 +0000 (08:36 -0500)
committerScott González <scott.gonzalez@gmail.com>
Tue, 2 Aug 2011 23:25:34 +0000 (19:25 -0400)
(cherry picked from commit dafc941b3632bb79823a72c36bfae7f1f985ca25)

ui/jquery.ui.mouse.js

index 7e38c69c444584a3f94a989071dc9b364f6f5ae3..5efa5e63a32adbc7281a536e2167969b53a5f7a8 100644 (file)
  */
 (function( $, undefined ) {
 
+var mouseHandled = false;
+$( document ).mouseup( 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;
        },