scriptaculous icon indicating copy to clipboard operation
scriptaculous copied to clipboard

Draggable revert and ghosting error

Open tonycoco opened this issue 14 years ago • 2 comments

Whilst creating a Draggable element and initializing it with both ghosting set to true and revert set to true the parentNode of the clone is never found and thus errors out.

tonycoco avatar Jan 21 '11 19:01 tonycoco

A simple test like, "new Draggable('demo_element', { revert: true, ghosting: true });" will blow up in your face.

tonycoco avatar Jan 21 '11 21:01 tonycoco

Sorry for a long response time - but you can fix the element after the revert by passing an anonymous function to revert and then reseting position and zIndex and returning false like below

new Draggable(div, { 
    "revert" : function(e){
        e.style.position = "relative";
        e.style.zIndex = '';
        return false;
    },
    "ghosting" : true
  });

jwestbrook avatar Nov 06 '12 01:11 jwestbrook