Permalink
Browse files

Make sure the click suppressor is unbound on the same element it has …

…been bound to at movestart.
  • Loading branch information...
1 parent d2adb48 commit 9f21ed5f45dd7a672694d0ede686bdb5f55ca5ab François Bruneau committed May 16, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 js/jquery.event.move.js
View
12 js/jquery.event.move.js
@@ -1,6 +1,6 @@
// jquery.event.move
//
-// 1.0.1
+// 1.0.2
//
// Stephen Band
//
@@ -29,6 +29,8 @@
remove = jQuery.event.remove,
+ movestartTarget = undefined,
+
// Just sugar, so we can have arguments in the same order as
// add and remove.
trigger = function(node, type, data) {
@@ -332,7 +334,8 @@
// Unbind the click suppressor, waiting until after mouseup
// has been handled.
setTimeout(function(){
- remove(e.target, 'click', returnFalse);
+ remove(movestartTarget, 'click', returnFalse);
+ movestartTarget = undefined;
}, 0);
});
}
@@ -458,7 +461,8 @@
// Stop clicks from propagating during a move
// Why? I can't remember, but it is important...
- add(e.target, 'click', returnFalse);
+ movestartTarget = e.target;
+ add(movestartTarget, 'click', returnFalse);
add(document, mouseevents.move, activeMousemove, data);
add(document, mouseevents.end, activeMouseend, data);
@@ -497,4 +501,4 @@
jQuery.event.props.push(props[l]);
}
}
-})(jQuery);
+})(jQuery);

0 comments on commit 9f21ed5

Please sign in to comment.