Skip to content

Commit

Permalink
Merge pull request #235 from kborchers/bug_4333_2
Browse files Browse the repository at this point in the history
Mouse: Changed mouseHandled check to a local var rather than using originalEvent. Fixed #4333 - Nested draggables problem in IE
  • Loading branch information
scottgonzalez committed May 9, 2011
2 parents 5ae44f8 + 9c50bdf commit f1180e5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ui/jquery.ui.mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
*/
(function( $, undefined ) {

var mouseHandled = false;
$(document).mousedown(function(e) {
mouseHandled = false;
});

$.widget("ui.mouse", {
options: {
cancel: ':input,option',
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -92,7 +95,8 @@ $.widget("ui.mouse", {
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);

event.preventDefault();
event.originalEvent.mouseHandled = true;

mouseHandled = true;
return true;
},

Expand Down

0 comments on commit f1180e5

Please sign in to comment.