Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing zIndex or left or top causes reset ? #14

Open
chrisribe opened this issue Jan 20, 2014 · 1 comment
Open

Changing zIndex or left or top causes reset ? #14

chrisribe opened this issue Jan 20, 2014 · 1 comment

Comments

@chrisribe
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant