How can you bind an event handler only if it doesn't already exist?
Unbind existing event handlers before you bind the new ones. This is really straightforward with namespaced events [docs]:
$(document)
.off('.upload') // remove all events in namespace upload
.on({
'dragenter.upload': function(e) {
e.stopPropagation();
e.preventDefault();
},
'dragover.upload': function(e) {
e.stopPropagation();
e.preventDefault();
},
// ...
});