Possible Duplicate:
How can I close a Twitter Bootstrap popover with a click from anywhere (else) on the page?
I would like the Twitter Bootstrap popover to close only when the user clicks outside of the popover. I don’t want clicks inside the popover closing the popover. I’ve searched and the answers for this are for even clicking the inside of the popover closes the popover. Please no gem suggestions too if possible because I am looking for a code solution.
Thank you!
html:
<a id="test-button" href="#" class="btn">Popover</a>
javascript/jquery:
$('#test-button').popover({content:"stuff", trigger:'click'});
I found this question, which APPEARS to be a duplicate, however the top answers did not work for me. I ended up modifying the code by adding a new click bind to .popover whenever one is toggled, which resulted in the desired effect.
Working jsFiddle: http://jsfiddle.net/asanger/AFffL/266/