Skip to content

Commit

Permalink
Merge pull request #2 from InteractiveIntelligence/IE-Fix
Browse files Browse the repository at this point in the history
Update draganddrop.js with hacks to get IE to show the right cursors during drag
  • Loading branch information
Jason Mobley committed Oct 23, 2015
2 parents c9aa651 + 3a56659 commit 3d65dba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions draganddrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,24 @@
}

if (valid) {
// Hacks for IE to get the valid icon for cursor.
e.dataTransfer.effectAllowed = 'copyMove';
if (e.dataTransfer.dropEffect === 'none') {
e.dataTransfer.dropEffect = e.ctrlKey ? 'copy' : 'move';
}

element.bind('dragover', onDragOver);
element.bind('dragenter', onDragEnter);
element.bind('dragleave', onDragLeave);
element.bind('drop', onDrop);

element.addClass(dragEnterClass);
} else {
// Hacks for IE to get the invalid icon for cursor.
if (e.dataTransfer.dropEffect === 'none') {
e.dataTransfer.effectAllowed = 'none';
}

element.bind('dragover', preventNativeDnD);
element.bind('dragenter', preventNativeDnD);
element.bind('dragleave', preventNativeDnD);
Expand Down

0 comments on commit 3d65dba

Please sign in to comment.