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 Aug 2, 2011
1 parent 70687f7 commit dafc941b3632bb79823a72c36bfae7f1f985ca25
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 ).mouseup( function( e ) {

This comment has been minimized.

Copy link
@creage

creage Sep 5, 2011

shouldn't this be mousedown?

mouseHandled = false;
});

$.widget("ui.mouse", {
version: "@VERSION",
options: {
@@ -45,9 +50,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));
@@ -93,7 +96,8 @@ $.widget("ui.mouse", {
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);

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

mouseHandled = true;
return true;
},

2 comments on commit dafc941

@creage

This comment has been minimized.

Copy link

creage replied Sep 5, 2011

You've reverted the code back, but previously it was

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

and you made it .mouseup - which causes an issue. I faced with problem dragging elements within two connected sortables - items wouldn't dragging until you click them.

@kborchers

This comment has been minimized.

Copy link
Member Author

kborchers replied Sep 6, 2011

If you have found a bug, please create a reduced, working test case on jsfiddle.net and then file the bug after checking to make sure it isn't already a known bug.

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