jquery-filedrop icon indicating copy to clipboard operation
jquery-filedrop copied to clipboard

Prohibits JqueryUI draggable from working.

Open jonahgoldsaito opened this issue 11 years ago • 2 comments

Any DOM element that has been run through filedrop() can no longer be used as a jquery UI draggable/sortable component.

I found that by commenting out //.on('dragstart', opts.dragStart); near the top of the file, jquery's draggable/sortable functionality is back in business.

I'm building a web app whose UI has sortable list items that need to be able to accept an image from the desktop.

Commenting that out means that a user defined dragstart method would not be called, but at least in my implementation, I'm not utilizing it. I imagine for others, leaving this out would be a problem.

Could the event be renamed "dragstart.filedrop" and still function.

jonahgoldsaito avatar Jun 21 '13 21:06 jonahgoldsaito

Hmm... I thought that namespacing the event might allow both to coexist, but apparently not.

jonahgoldsaito avatar Jun 21 '13 21:06 jonahgoldsaito

I have them both working, but I had to add a couple lines of code to prevent filedrop from throwing an error on non-file drops.

function drop(e) {
   if( opts.drop.call(this, e) === false ) return false;
   if( typeof(e.dataTransfer) !== 'object' ) return false;
   if(e.dataTransfer === null) return false;
   files = e.dataTransfer.files;

cdenley avatar Aug 13 '13 14:08 cdenley