pec1985 / TiDraggable

Native iOS and Android modules for Appcelerator's Titanium Mobile
74 stars 75 forks source link

Changing zIndex or left or top causes reset ? #14

Open chrisribe opened 10 years ago

chrisribe commented 10 years ago

Hi first off great module the dragging is super smooth !

One question, I am trying to change the zIndex on the end event. As soon as I set e.source.setZIndex(3) the source seems to get reset to it's original position!?

So how can I change the Draggable view position / properties after it has been dragged ?

Thanks

chrisribe commented 10 years ago

Humm I seem to have figured out a workaround...

On the end event I re-assign the top, left of the e.source to itself.... This seems to allow me to keep the last position values and allows me to modify the zIndex without the nasty position reset.

el1.addEventListener('end', function(e)
{
    e.source.setLeft(e.source.left);
    e.source.setTop(e.source.top);

    e.source.setZIndex(<SOME CALCULATED VALUE>);
});

Thanks again for the module.