-
Notifications
You must be signed in to change notification settings - Fork 102
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
Expose cleanup() method #328
Comments
I think you are right, we need such method in the API. But I don't satisfied with the |
@vladimir-socialsweethearts hi! We'll finish and release the methods for destroy widget early next year. |
@Zmoki Just wondering if there's a temporary workaround for this on already initialized widgets to clean it up? Turbolinks (for Rails) is causing a problem as it caches the pages, and so if the back button is pressed, the same input[role='uploadcare-uploader'] is initialized multiple times. I'm currently doing the following:
|
Any news for this issue? |
Currently, there is no way to cleanly destroy a Widget from the DOM, which is critical in SPA setups.
The functionality exists, however, in the form of a
cleanup()
method:https://github.com/uploadcare/uploadcare-bower/blob/master/uploadcare.js#L8075
But since it's wrapped in a closure, it is not publicly exposed. I think there should be a
destroy
method on a Widget instance to handle this properly.The text was updated successfully, but these errors were encountered: