twitter/bootstrap — Issue #2374: Tooltip and delegate
Author: clinisbut
Created: 2012-03-02 13:55:07+00:00
State: open

Hi
I'm trying to configure different tooltips for my site. I know I will have a different set of tooltips, say tooltips with placement on top and tooltips with placement on right.
As I need delegate (I add elements on the document dynamically), I use `body` as root element:

$('body').tooltip({
selector:'[rel=tooltip]'
});
$('body').tooltip({
selector:'[rel=tooltip-right]',
placement:'right'
});

As the `data('tooltip')` is appended to the element body, the second call to `$('body').tooltip` does not create a new Tooltip object even a different `selector` is used.

Is this the right approach or simply can't be done?

I've tried to generate append random string to the data key 'tooltip' if a selector is provided, but for some reason the `selector` option is cleared on `Init` and then `enter` and `leave` events are not able to instantiate correctly `self`.