Skip to content

Commit 9c50bdf

Browse files
committed
Mouse: Changed mouseHandled check to a local var rather than using originalEvent. Fixed #4333 - Nested draggables problem in IE
1 parent af5b5b1 commit 9c50bdf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ui/jquery.ui.mouse.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
*/
1313
(function( $, undefined ) {
1414

15+
var mouseHandled = false;
16+
$(document).mousedown(function(e) {
17+
mouseHandled = false;
18+
});
19+
1520
$.widget("ui.mouse", {
1621
options: {
1722
cancel: ':input,option',
@@ -44,9 +49,7 @@ $.widget("ui.mouse", {
4449

4550
_mouseDown: function(event) {
4651
// don't let more than one widget handle mouseStart
47-
// TODO: figure out why we have to use originalEvent
48-
event.originalEvent = event.originalEvent || {};
49-
if (event.originalEvent.mouseHandled) { return; }
52+
if(mouseHandled) {return};
5053

5154
// we may have missed mouseup (out of window)
5255
(this._mouseStarted && this._mouseUp(event));
@@ -92,7 +95,8 @@ $.widget("ui.mouse", {
9295
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
9396

9497
event.preventDefault();
95-
event.originalEvent.mouseHandled = true;
98+
99+
mouseHandled = true;
96100
return true;
97101
},
98102

0 commit comments

Comments
 (0)