tether icon indicating copy to clipboard operation
tether copied to clipboard

Tether to elements that haven't been inserted into the DOM

Open jayd3e opened this issue 11 years ago • 3 comments

The title says it all. Is there a way that I can tether to an element that has yet to be inserted into the DOM. My usecase for this is I'm creating backbone views and attaching an element to them. This element may/may not be inserted into the DOM as I'm initializing the view. I want to be able to setup all my tooltip logic in the initialize function of each view, and then when the elements are put into the DOM, everything should just work. Here is the relevant codepen to explain http://codepen.io/jayd3e/pen/kLiKF.

jayd3e avatar Sep 30 '14 22:09 jayd3e

It appears this is possible if I remove this else statement https://github.com/HubSpot/drop/blob/master/drop.js#L1618. What is the purpose of that?

jayd3e avatar Sep 30 '14 23:09 jayd3e

why can't you just use event delegation and generate the tether and link it to the element using jQuery data method, so later the tether object would be cached, so you won't need to generate it again, only enable/disable it. This is what I do.

yairEO avatar Nov 04 '14 13:11 yairEO

Its still not clear how this is supposed to work... @yairEO can you provide an example?

nhagen avatar Aug 11 '15 16:08 nhagen