Skip to content

Commit e15c32d

Browse files
committed
Merge pull request jquery#413 from kborchers/bug_4333_3
Mouse: Changed mouseHandled check to a local var rather than using originalEvent. Fixed #4333 - Nested draggables problem in IE
2 parents 6ca310f + dafc941 commit e15c32d

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 ).mouseup( function( e ) {
17+
mouseHandled = false;
18+
});
19+
1520
$.widget("ui.mouse", {
1621
version: "@VERSION",
1722
options: {
@@ -45,9 +50,7 @@ $.widget("ui.mouse", {
4550

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

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

9598
event.preventDefault();
96-
event.originalEvent.mouseHandled = true;
99+
100+
mouseHandled = true;
97101
return true;
98102
},
99103

0 commit comments

Comments
 (0)