Popover data attributes ignored when using selector option
Created by: neilgoodman
I have setup a web application to use the data-api of the popover plugin:
$(function () {
$('body').popover({
selector: '[data-toggle="popover"]'
});
});
My HTML looks like this for the popover:
<a class="btn" data-toggle="popover" data-placement="bottom" data-html="true" data-content="<strong>test</strong>">Popover Test</a>
Now when I click the button, the popover does show up, but none of the data attributes are being used. This was not the case in 2.2. I think the issue is on this line in bootstrap-tooltip.js:
https://github.com/twitter/bootstrap/blob/v2.3.0/js/bootstrap-tooltip.js#L70
A possible fix could be:
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
Another area this could be fixed:
https://github.com/twitter/bootstrap/blob/v2.3.0/js/bootstrap-tooltip.js#L64 https://github.com/twitter/bootstrap/blob/v2.3.0/js/bootstrap-tooltip.js#L83 https://github.com/twitter/bootstrap/blob/v2.3.0/js/bootstrap-tooltip.js#L95
Maybe get rid of the _options
property all together? Not sure, so that's why I'm posting this as an issue.