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

There is no way to remove the event listeners once they are added #14

Open
wardtm11 opened this issue Apr 6, 2015 · 1 comment
Open

Comments

@wardtm11
Copy link

wardtm11 commented Apr 6, 2015

I noticed that there is no way to add and remove nativesortable's functionality "easily" on the fly - the only way I have been able to remove the functionality is by cloning the element I added it to, and replacing the original with the clone (removes all listeners). I believe this is because the functions attached to the listeners are private, and are treated as anonymous by the browser - so I have no way to remove them directly.

There might be something I'm missing, though. Is there any way to add this to an element and remove it without recreating the element?

@bgrins
Copy link
Owner

bgrins commented Apr 25, 2015

You are right, there isn't a way to destroy the functionality right now. If someone would be interested in adding this, I'd accept a PR. We could make nativesortable return an object with a destroy function that cleans up after itself.

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

2 participants