jQuery-Collapse
jQuery-Collapse copied to clipboard
Add a "destroy" method
First off, excellent plugin.
It would be very nice to be able to remove all collapse click handlers and expand all of the collapsed items programmatically, perhaps like $("myelement").collapse("destroy");
My use case is for a responsive site. On small screens I collapse all of the sections, similar to mobile Wikipedia. On larger screens all of the sections are open, similar to desktop Wikipedia. On large screens I don't want the user to be able collapse sections so I need to unbind all of those click handlers.
Really the destroy method would undo everything that the plugin has done earlier, e.g., remove ARIA attributes, remove elements that were created, unbind events, etc.
Yeah I gotcha, let me think about it for a while :)
Edit: I'm a bit busy now, but you're welcome to submit a pull request
+1
+1
+1
Hi,
Thanks for this great plugin ! +1 This feature really would be welcome for responsive sites. Missing no more than that to it becoming a perfect plugin. ;-)
Have a good day.
+1 this is also useful for single page applications when events have to be destroyed when removing elements from DOM.
+1 @danielstocks Thx for your plugin. On 27 Feb 2014 you stated you think about a destroy feature. Any plans implementing this? THX
+1
This is useful for turbolink applications where we need to initialize/destroy ...