calebjacob / tooltipster

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

Fix for iframe #783

Open petko opened 4 years ago

petko commented 4 years ago

I've tried to use your plugin inside TinyMCE editor. Due to the following function it does not work, but it is easy to fix by changing both occurrences of env.window.document to $obj[0].ownerDocument here:

https://github.com/iamceege/tooltipster/blob/f818f589de54165209756aa3319f49f841d708a2/src/js/tooltipster.js#L3286-L3291

TinyMCE uses iframe for the elements in the editor, so they have different document object than the main one.

louisameline commented 4 years ago

Hello, thanks for your message. So your tests show that it works with this modification? It seems like a harmless change, this is doable.

louisameline commented 4 years ago

I wonder what the ownerDocument for detached nodes is. null maybe? If so the test needs to change slightly.

petko commented 4 years ago

I can't find any information about it, but null sounds logical..