on methods bound to document instead of initSelector

When script files are in the head of the document, $( initSelector
).on() does not work, because $( initSelector ).length is 0. This works
fine with live(), but not with on(). When we bind on to document $(
document ).on('....', initSelector, ...) it works fine.
added check for data argument in dragend handler

mouse dragging also triggers dragend event, but without sending data.
this causes an error. added a check to see if data argument is supplied