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 hide() also destroy? #41
Comments
Good question. I had a very similar discussion recently #35 where I argued that having the possibility to remove the actual DOM elements was something I'd like to implement in the near future, but have been convinced that performing DOM manipulation on the Opentips is more important – but that conflicts with your needs. For now: Opentip HTML elements are only created when they are shown and not when the Opentip is created. So your save creating lots of Opentips. Would a "removeElementsOnHide" option satisfy your needs? |
Adding the option "removeElementsOnHIde" would be a great solution. I was wondering if I needed to set something to null or if there was a procedure to follow. I haven't looked at the code as it's working great. |
Ok. It's not really on top of my priority list though. If you have performance issues and need this to be done sooner than later just bump this issue. |
Thank you for considering adding it. By the way, I really like the Native option of the code. Thank you for making this work without the use of a framework. This was a huge reason I tried opentip. |
Thanks :) It caused a lot of headaches |
Oh no... I just realised that I lied. Some basic elements are always inserted when an Opentip is constructed... :-/ I'll have a look at it. |
|
Wow that was fast. Thank you!!!! I'll try it out today. |
First of all, congratulation for your great job.. i would like to ask you one thing about Opentip, and more specifically about the destruction of the element. The removeElementsOnHide function is great, but is it possibile to ask a function for destroy the element not only when is hided? Because i use the cache and the function above it's not useful to me in this case.. |
What do you mean? You can't just delete the elements when it's visible obviously. |
I think I explained myself badly, i don't want to destroy the element when it's visible, i meant that it will be useful add a function, for example "destroy", to destroy the element so it can be substitute by another (useful for repeated ajax call when the target changes its state), or an "update content" function, is only a suggestion obviously, currently i do it looking at the source of "Removing HTML elements". |
There is a |
done it, thanks |
Hey, the global namespace After using my onPageApp (quite heavily) for around 5 minutes i have ~ 400 tooltips created. I have also DOM elements removed from the page but still the tooltips availabale in the Do you have a trick to cleanup those tooltips completely to avoid memory leaks? |
Hey, I have had the same issues, where i run a check every 2 seconds on a page. This is not only increasing the Openytip.tips array but it also keep on adding loads of containers which makes the shadow go overboard. So the fix is (opentip-native.js line +- 1444): Opentip.findElements = function(){ Next version, it would be great that the above solution can be implemented as well as allowing the user to change the default attribute as data-id may well be used. Hope it helps. Cheers |
If the tool tip is created programmatically, and shown on create and then hidden on keydown, will the tool tip also be destroyed automatically when hidden?
I am using Opentip for form validation so when an error is detected, new Opentip() is called and then when the user starts to type, the tool tip hides.
This one page has many form fields in many tab groups. The browser stays at one url for hours. Tabs and html windows ajax dynamic content as needed.
Guess the point is "new Opentip()" might be called hundreds of times so unless these are getting destroyed or there is a better way to show the tool tip, this might present a memory leak.
Do i need to worry about this or does Opentip handle it?
The text was updated successfully, but these errors were encountered: