twitter/bootstrap — Issue #641: popover strips all function returned content of eventHandlers
Author: pixxelboy
Created: 2011-11-16 11:46:31+00:00
State: open

I'm currently working on the implementation of the popover plugin with custom javascript generated content.
Here's a snippet of what I'm doing

```javascript
$('.colorInput').each(function(){
var src = $(this);

src.popover({
html: true,
content: function(){
return $('').farbtastic(src);
},
trigger: 'manual'
}).focus(function(e){
$(this).data('data-default', $(this).val());
$('.colorInput').each(function(){
$(this).popover('hide');
});
src.popover('show');
}).blur(function(e){
if($(this).data('data-default') != $(this).val())
{
formSubmit();
}
//src.popover('hide');
});
});
```
While it's fairly simple to understand, and after examining the content generated using

```javascript
content: function(){
console.log($('').farbtastic(src));
return $('').farbtastic(src);
}
```
the console.log shows a DOM fragment with proper events attached. But as soon as popover sets it's content based on this return, this same fragment looses all behaviours expected (set in my case by the farbtastic plugin).

Thanks for both reading and help !!