View Full Version : Issue with scriptaculous custom onDrop in IE

08-10-2009, 08:42 PM
I'm attempting to modify the scriptaculous drag/drop behavuior so that when I drag an icon into a droppable, it makes a copy (same ID, class, etc) in the droppable, and removes the original.

Here is the function I came up with to put in the onDrop parameter of my droppables:
function DropHandler(element,el){
var newnode = document.createElement('img');
var classname = element.className;
newnode.setAttribute("class", classname);
newnode.setAttribute("className", classname);
newnode.id = element.id;
new Draggable(newnode.id,{revert:true});
This code works perfectly in firefox, but in IE, after you drop it will continuously place a copy of the draggable elements onmouseup to whatever droppable my mouse happens to be over at the time of my mouseup.

After a while it stops, but all my draggables are broken and do not work.

This especially puzzling because it works *perfectly* as planned in firefox.

08-10-2009, 09:10 PM
i hit an odd issue with drag\drop having issues in IE after a few. maybe 12-15 drap\drops and it would stop working until the page reloaded. never really found a good explanation.

08-10-2009, 09:58 PM
More info: Using more primitive debugging techniques, the error seems to be in the line " element.parentNode.removeChild(element);" commenting this out allows the rest of the code to function, but leaving it in throws an error of "object expected", it's hard to tell more without a debugger.