-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Feature request: destroy method for all jQuery plugins #7166
Comments
Please search next time: #6315. |
Sorry. I searched but I didn't see this one. But I'm afraid the solution mentioned in this post isn't a a solution to my All in all... what is written in the mentioned post is not a complete Sorry for this tone. Regards Oliwer Hawlickie-mail: [email protected] On 6 March 2013 18:55, Mark Otto [email protected] wrote:
|
I think you can unbind e.g. just the typeahead events with: $(document).off('.typeahead.data-api') |
Maybe in case of typeahead that would work. But not with carousel. I repeat again. Unbinding events is not a way to destroy a plugin (it's Pozdrawiam Oliwer Hawlickie-mail: [email protected] On 11 April 2013 10:40, William Meleyal [email protected] wrote:
|
@retan , Did you find the solution to deactivate the bootstrap carousel plugin? |
Hi Yes I did. Be aware that I was working with 2.3.0 version (not the current In short... Instead in the main.js file: The pause method involeves calling "clearInterval()" (whithout doing it, At that time I was looking for a quick solution so it's a bit of a mess, Good luck! Oliwer Hawlicki On 10 October 2013 15:36, phkavitha [email protected] wrote:
|
@retan , Thanks for your help. I did tried your solution. In fact, the carousel gets stopped. But, when I take the heap snapshot, I can find the whole carousel html under Detached DOM tree. |
Hello I'm afraid, that there is no. At that time I didn't have time to write one. Pozdrawiam Oliwer Hawlickie-mail: [email protected] On 21 October 2013 07:17, phkavitha [email protected] wrote:
|
Hello
I've been struggling with this problem - the lack of destroy method, especially for Carousel - for a few evenings now. At first I tried to solve it from the outside of the plugins, in the script calling the plugins, trying to remove all elements, data, and events, that the plugins attach but with no luck (always at runtime some errors occur).
This evening, when I took a look inside boostrap.js., I have noticed, that most event handlers are attached without a namespace. This makes it difficult to track and unbind all events, that the plugins are attaching.
Why the need for destroy method? In my case I want some plugins (especially Carousel) to switch on and off, depending on the size of the window (on for wide window, off for narrow window). The state should be updated as the user resizes the window. And I don't want the running in background when they are not needed.
For the time being, I guess I will rewrite a bit my copy of bootstrap.js, adding the namespaces to event attachments, and some simple destroy, but I would appreciate if this feature would be available by default.
Regards
Oliwer
The text was updated successfully, but these errors were encountered: