Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open only one popover at a time #9

Open
map526 opened this issue Jun 17, 2014 · 0 comments
Open

Open only one popover at a time #9

map526 opened this issue Jun 17, 2014 · 0 comments

Comments

@map526
Copy link

map526 commented Jun 17, 2014

Using bootstrap 3.1.1 - I've added the function to hide all popovers other than the one selected, but for some reason the previous popover remains open when I click a new one

This is the code I'm adding:
$(function () {
$("[data-toggle='popover']").popover();
$('.popover-toggle').popover('toggle');
$('body').on('click', function (e) {
$('[data-toggle="popover"]').each(function () {
//the 'is' for buttons that trigger popups
//the 'has' for icons within a button that triggers a popup
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
$(this).popover('hide');
}
});
});
});

Any idea how to fix @tarlepp or @dkleehammer ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant