-
Notifications
You must be signed in to change notification settings - Fork 53
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
does wcDocker have a destroy-function? #103
Comments
If you are talking about destroying a panel, However, if you have specific things you would need to clean up while your panel is being destroyed, you should register the following event handlers for it: http://docker.api.webcabin.org/module-wcDocker.html#toc4 Does this help? |
Hello Jeff, My colleague has missed to describe the scenario. We build a Single Page Application with Angular. We have several modules with different content. When the user switch from one module to another, angular, for been precise the ui-router will remove the docker-directive and create a new instance. In the docker-directive we will watch the directive destroy event. When this event occurs we have to clean up the memory. We have to dispose the panel but also the docker instance. Therefore a destroy function which knows the docker events etc. would be helpful. How can we handle this use case? Thank you, |
Ahh, I don't know why I did not name it
After calling this, it should be safe to simply un-reference the wcDocker object and allow the browser to garbage collect it. Also note, the clear method only triggers |
Perfect Jeff, clear() works for now and is excactly what I was looking for. |
It should, actually. I've committed that change right after I mentioned it ;) |
@Lochemage ah you mean your exposed wcDocker-events - i see. |
I do not know if this is very smart, but since you use event-delegation, the simplest way to "decouple" the events would be to bind to $('body.wcDesktop') instead of $('body') and removing the class wcDesktop from body when using clear(). |
Ahh, I understand. As for the mouse handler events, I have some plans to refactor that somewhat, I'll make sure this also includes unbinding them. |
A destroy-function is not documented, so is there a way to free memory after removing it?
Thanks, Sebastian
The text was updated successfully, but these errors were encountered: