I think your idea is good. If I've understood correctly:
1. In all supported browsers except Opera, when you drag (mousedown, mousemove, mouseup) the mouseup is followed by a click
2. The click event doesn't make sense at the end of a drag (my words), and causes a problem if the user started dragging on a link (which can be followed assuming distance > 0, if no drag had started).
3. If dragging starts, we want to eat that final click following mouseup
If I've understood completely, I don't think this warrants a change to what mouseStop means, nor when it's triggered. I think (as you've shown below) we simply need to cancel that click that follows.
A few quick notes:
1. We should not just preventDefault, but return false (so that it doesn't bubble).
2. We should not limit this to links. Regardless of the element type, I don't think a click at the end of a drag makes sense, and is quite unexpected.
3. I know what you've written below is just pseudo-code, but for the unbind it can't be e.target, it needs to be a cached reference to the element, since there's no guarantee that mouseup happens on the same element as mousedown at the end of a drag. In any case, the click handler/eater should be unbound.
Otherwise, looks good.
Any chance this needs to be exposed so that each plugin can handle differently? Or are we safe saying "If a drag started, it shouldn't end with a click wherever mouseup happens"
- Richard