Re: [jquery-dev] Teardown on plugins

2009-12-16 Thread Jörn Zaefferer
More complete, each widget binds to that remove-event to call its destroy-method. Though due to the event-handling overhead involved, we explored other approaches Jörn On Mon, Dec 14, 2009 at 6:42 PM, John Resig wrote: > jQuery UI does a similar thing (overriding .remove() to generate a > .trig

Re: [jquery-dev] Teardown on plugins

2009-12-16 Thread Jörn Zaefferer
More complete, each widget binds to that remove-event to call its destroy-method. Though due to the event-handling overhead involved, we explored other approaches as well, where an element maintains a list of all widgets... Jörn On Mon, Dec 14, 2009 at 6:42 PM, John Resig wrote: > jQuery UI doe

Re: [jquery-dev] Teardown on plugins

2009-12-14 Thread John Resig
jQuery UI does a similar thing (overriding .remove() to generate a .trigger("remove") event). Would something like that work for your needs? --John On Mon, Dec 14, 2009 at 11:43 AM, Justin Meyer wrote: > Is there a 'teardown' for plugins that can get triggered automatically > (similar to that

[jquery-dev] Teardown on plugins

2009-12-14 Thread Justin Meyer
Is there a 'teardown' for plugins that can get triggered automatically (similar to that for events)? It's extremely common, and a source of bugs when I see: $.fn.mySuperPlugin = function(){ ...code ... $(document).click(function(e) { ...code... }); ...code... } Yes, they should be doing adding/r