maxwells / bootstrap-tags

Bootstrap-themed jquery tag interface
MIT License
549 stars 134 forks source link

Popover content hides too quickly #7

Closed sappenin closed 11 years ago

sappenin commented 11 years ago

Is there a way to keep the popover content from going away immediately after mousing-out of the tag? Ideally, the popover content would only go away if another area of the bootstrap-tags UI is clicked, or something outside of the bootstrap-ui is clicked.

For example, if I have a link in the popover, I am currently unable to click that link because the popover disappears as soon as I mouseout of the tag and move into the popover.

maxwells commented 11 years ago

Gotcha. Totally valid.

I am thinking to provide an option for setting popover behavior:

Does that match up with what you were suggesting?

maxwells commented 11 years ago

Pushed change that allows for three different popover trigger types: 'click' - need to click a specific tag to show and hide 'hover' - mouseover/out shows/hides a specific tag 'hoverShowClickHide' - hovering over a tag will hide all other popovers and show the one associated with the tag moused over. Clicking anywhere in the document will hide all popovers.

$(selector).tags({
    popoverTrigger: 'click' // or 'hover' or 'hoverShowClickHide'
});

If 'hoverShowClickHide' doesn't end up working with links, let me know. I didn't end up testing it, because I wasn't successful at putting a link into a popover (am using http://twitter.github.io/bootstrap/javascript.html#popovers)

sappenin commented 11 years ago

Nice, thanks!