Skip to content

Instantly share code, notes, and snippets.

@DominikStyp
Created March 8, 2018 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominikStyp/8e1ca813975c880be1cb6b3c882babce to your computer and use it in GitHub Desktop.
Save DominikStyp/8e1ca813975c880be1cb6b3c882babce to your computer and use it in GitHub Desktop.
Popover-X hide on body click, but not on popover click.
$('body').on('click', function (e) {
var isPopoverClicked = ($(e.target).parents('.popover-x').length > 0);
var isButtonPopoverClicked = $(e.target).is('.publicKeyPopoverButton');
if(isPopoverClicked || isButtonPopoverClicked){
return true;
}
$('.popover-x').popoverX('hide');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment