Sortable and e.originalTarget in start for WebKit
It looks like the Sortable plug-in has an issue in WebKit where the
e.originalTarget is not set in the start and stop handlers.
Specifically I've created a sortable and needed to surpress clicks
firing from the drop operation of the sortable item. The code below
works in IE and FireFox, but in Safari/Chrome e.originalTarget is
undefined resulting in the unbind/rebind operations being ignored:
$("#divBookListWrapper").sortable(
{
opacity: 0.7,
revert: true,
scroll: true,
containment: "parent",
start: function(e) {
// have to remvoe click handler off item so drop doesn't click
//$(".bookitem").unbind("click");
$(e.originalTarget).unbind("click");
},
stop: function(e) {
$(ctl).data("Sort", "1");
$(ctl).html($(ctl).html().replace("Sort List", "Update
Sort"));
// reattach the item click handler
$(e.originalTarget).click(itemClickHandler);
//$(".bookitem").click(itemClickHandler);
}
});
I can usually work around this by removing ALL click handlers (see
commented code) on all items but this is obviously a lot more
inefficient and impractical in larger lists.
FWIW, it'd also be really nice if the sortable had some sort of option
of surpressing click events on whatever it's dragging or more
specifically passing mouse events on to the element being dragged.