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

Idea : close popover on next click #10140

Closed
cameleonhelp opened this issue Aug 25, 2013 · 4 comments
Closed

Idea : close popover on next click #10140

cameleonhelp opened this issue Aug 25, 2013 · 4 comments

Comments

@cameleonhelp
Copy link

Is it possible to add a options to make over popover hidden when we click on a popover or on the body (html page)

For the feature version.

Thank's for your work

@Merg1255
Copy link

This one has been mentioned in previous versions.
The thing is that BS3 should not bloat the $(body,html) with events, so as to have room for faster websites.

@IsaiahvH
Copy link

IsaiahvH commented Nov 2, 2013

I'm using this:

$(':not(#anything)').on('click', function (e) {

        $('.popover-link').each(function () {
            //the 'is' for buttons that trigger popups
            //the 'has' for icons and other elements 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');
                return;
            }
        });
    });

@fat
Copy link
Member

fat commented Dec 24, 2013

this behavior already works… you should just use the trigger option focus. Example:

http://jsbin.com/AgAkiDo/5

@mdo – you may want to remove from your roadmap

@fat fat closed this as completed Dec 24, 2013
@Merg1255
Copy link

hm, @fat yep you're right.. :-)

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

No branches or pull requests

4 participants