calebjacob / tooltipster

A jQuery tooltip plugin
MIT License
2.76k stars 480 forks source link

Code in functionReady not executed when using ajax with async:true #780

Closed gbastien closed 5 years ago

gbastien commented 5 years ago

Hi @louisameline

we are using tooltipster thru it's integration package https://github.com/collective/collective.js.tooltipster in Plone CMS and we encounter a problem when using the functionReady when the functionBefore uses an ajax call with async:true. It seems that the ajax call is still not finished when the functionReady is called in this case. It works fine when using async:false, but this leads to other problems like no spinner in Chrome when ajax async:false...

Could you tell me how to be sure in functionReady that the functionBefore has finished?

Thank you!

Gauthier

louisameline commented 5 years ago

Hi Gauthier,

Yes, the library does not wait: in functionBefore you can only stop the process of displaying a tooltip, not return a promise or something like that. I suggest you do stop the process in functionBefore, and open the tooltip via the open API method when you are done and ready.