Skip to content
Permalink
Browse files

Mouse: Changed mouseHandled check to a local var rather than using or…

…iginalEvent. Fixed #4333 - Nested draggables problem in IE
  • Loading branch information...
kborchers committed May 9, 2011
1 parent af5b5b1 commit 9c50bdfde0260fc8412eec1c5020ed6b61558ebd
Showing with 8 additions and 4 deletions.
  1. +8 −4 ui/jquery.ui.mouse.js
@@ -12,6 +12,11 @@
*/
(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;
},

1 comment on commit 9c50bdf

@brettkiefer

This comment has been minimized.

Copy link

commented on 9c50bdf Jul 13, 2011

This looks like it causes some problems with stopping propagation of events. Is it possible to take another approach? It seems like we can't assume that the event will reach the top-level document. http://bugs.jqueryui.com/ticket/7544

Please sign in to comment.
You can’t perform that action at this time.