-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Implements destroy() method #162
Implements destroy() method #162
Conversation
Wait for merging. There are problems with the UT and the way I destroy everything. |
Ok now it is working. |
// Empty the container (this will also detach all event listeners) | ||
self.$container.empty(); | ||
// Detach the global resize event handler | ||
if (self.onResizeEvent) $(window).off("resize." + pluginName, self.onResizeEvent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just call $(window).off("resize." + pluginName);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have two maps you will detach all events in that case :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right, I didn't thought about that case :)
Great work, thank you ! I merge your PR :) |
Finalize #117 and fix last leak in #118!