Skip to content

Instantly share code, notes, and snippets.

@andreas-marschke
Last active December 12, 2015 09:28
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 andreas-marschke/4751200 to your computer and use it in GitHub Desktop.
Save andreas-marschke/4751200 to your computer and use it in GitHub Desktop.
When you have a set of collapsibles inside a modal events from inside like "shown" are bubbling up. So unless you make sure it's only the modal you are listening to, the callback will fire anyway. Better make sure it only happens once.
$("#modal").modal({
show: true,
backdrop: true,
keyboard: true
}).on("shown",function(e) {
/* suppress 'shown' events bubbling up from inside */
if ($(e.target).hasClass('modal')){
/*do something*/
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment